ServiceInfoFlags Enum
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Enumerates values returned by several types.
This enumeration supports a bitwise combination of its member values.
[System.Flags]
public enum ServiceInfoFlags
[<System.Flags>]
type ServiceInfoFlags =
- Inheritance
-
ServiceInfoFlags
- Attributes
Fields
| Name | Value | Description |
|---|---|---|
| StopWithTask | 1 | Bit in flags: If set, the service will automatically be stopped by the system if the user removes a task that is rooted in one of the application's activities. Set from the R.attr.stopWithTask attribute. Android reference for Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License. |
| IsolatedProcess | 2 | Bit in Flags: If set, the service will run in its own isolated process. |
| ExternalService | 4 | Bit in flags: If set, the service can be bound and run in the calling application's package, rather than the package in which it is declared. Set from R.attr.externalService attribute. Android reference for Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License. |
| UseAppZygote | 8 | Bit in flags: If set, the service (which must be isolated) will be spawned from an Application Zygote, instead of the regular Zygote. The Application Zygote will pre-initialize the application's class loader, and call a static callback into the application to allow it to perform application-specific preloads (such as loading a shared library). Therefore, spawning from the Application Zygote will typically reduce the service launch time and reduce its memory usage. The downside of using this flag is that you will have an additional process (the app zygote itself) that is taking up memory. Whether actual memory usage is improved therefore strongly depends on the number of isolated services that an application starts, and how much memory those services save by preloading. Therefore, it is recommended to measure memory usage under typical workloads to determine whether it makes sense to use this flag. Android reference for Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License. |
| AllowSharedIsolatedProcess | 16 | Bit in flags: If set, and this is an R.attr.isolatedProcess service, the service is allowed to be bound in a shared isolated process with other isolated services. Note that these other isolated services can also belong to other apps from different vendors. Shared isolated processes are created when using the Context.BIND_SHARED_ISOLATED_PROCESS during service binding. Note that when this flag is used, the R.attr.process attribute is ignored when the process is bound into a shared isolated process by a client. Android reference for Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License. |
| NativeService | 32 | Bit in flags: If set, the system does not initialize the Android Runtime in a process which runs the service. Instead the system loads a library into the process and then starts the service from the entrypoint function in the library. The library and the entrypoint names are specified in metadata to the service tag. This flag is ignored if FLAG_ISOLATED_PROCESS is false or isn't specified. Set from the R.attr.nativeService attribute. Android reference for Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License. |
| SingleUser | 1073741824 | Bit in Flags: If set, a single instance of the service will run for all users on the device. |
Remarks
Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.