Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels) Summary: [Constants](https://developer.android.com/reference/android/content/pm/ServiceInfo#constants) \| [Inherited Constants](https://developer.android.com/reference/android/content/pm/ServiceInfo#inhconstants) \| [Fields](https://developer.android.com/reference/android/content/pm/ServiceInfo#lfields) \| [Inherited Fields](https://developer.android.com/reference/android/content/pm/ServiceInfo#inhfields) \| [Ctors](https://developer.android.com/reference/android/content/pm/ServiceInfo#pubctors) \| [Methods](https://developer.android.com/reference/android/content/pm/ServiceInfo#pubmethods) \| [Inherited Methods](https://developer.android.com/reference/android/content/pm/ServiceInfo#inhmethods)

# ServiceInfo

*** ** * ** ***

` public class ServiceInfo `   
` ` ` ` ` extends https://developer.android.com/reference/android/content/pm/ComponentInfo ` ` implements https://developer.android.com/reference/android/os/Parcelable `

|---|---|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) ||||
| ↳ | [android.content.pm.PackageItemInfo](https://developer.android.com/reference/android/content/pm/PackageItemInfo) |||
|   | ↳ | [android.content.pm.ComponentInfo](https://developer.android.com/reference/android/content/pm/ComponentInfo) ||
|   |   | ↳ | android.content.pm.ServiceInfo |

<br />

*** ** * ** ***

Information you can retrieve about a particular application service. This corresponds to information collected from the AndroidManifest.xml's \<service\> tags.

## Summary

| ### Constants ||
|---|---|
| `int` | `https://developer.android.com/reference/android/content/pm/ServiceInfo#FLAG_ALLOW_SHARED_ISOLATED_PROCESS` Bit in `https://developer.android.com/reference/android/content/pm/ServiceInfo#flags`: If set, and this is an `https://developer.android.com/reference/android/R.attr#isolatedProcess` service, the service is allowed to be bound in a shared isolated process with other isolated services. |
| `int` | `https://developer.android.com/reference/android/content/pm/ServiceInfo#FLAG_EXTERNAL_SERVICE` Bit in `https://developer.android.com/reference/android/content/pm/ServiceInfo#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. |
| `int` | `https://developer.android.com/reference/android/content/pm/ServiceInfo#FLAG_ISOLATED_PROCESS` Bit in `https://developer.android.com/reference/android/content/pm/ServiceInfo#flags`: If set, the service will run in its own isolated process. |
| `int` | `https://developer.android.com/reference/android/content/pm/ServiceInfo#FLAG_NATIVE_SERVICE` Bit in `https://developer.android.com/reference/android/content/pm/ServiceInfo#flags`: If set, the system does not initialize the Android Runtime in a process which runs the service. |
| `int` | `https://developer.android.com/reference/android/content/pm/ServiceInfo#FLAG_SINGLE_USER` Bit in `https://developer.android.com/reference/android/content/pm/ServiceInfo#flags`: If set, a single instance of the service will run for all users on the device. |
| `int` | `https://developer.android.com/reference/android/content/pm/ServiceInfo#FLAG_STOP_WITH_TASK` Bit in `https://developer.android.com/reference/android/content/pm/ServiceInfo#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. |
| `int` | `https://developer.android.com/reference/android/content/pm/ServiceInfo#FLAG_USE_APP_ZYGOTE` Bit in `https://developer.android.com/reference/android/content/pm/ServiceInfo#flags`: If set, the service (which must be isolated) will be spawned from an Application Zygote, instead of the regular Zygote. |
| `int` | `https://developer.android.com/reference/android/content/pm/ServiceInfo#FOREGROUND_SERVICE_TYPE_CAMERA` Constant corresponding to `camera` in the `https://developer.android.com/reference/android/R.attr#foregroundServiceType` attribute. |
| `int` | `https://developer.android.com/reference/android/content/pm/ServiceInfo#FOREGROUND_SERVICE_TYPE_CONNECTED_DEVICE` Constant corresponding to `connectedDevice` in the `https://developer.android.com/reference/android/R.attr#foregroundServiceType` attribute. |
| `int` | `https://developer.android.com/reference/android/content/pm/ServiceInfo#FOREGROUND_SERVICE_TYPE_DATA_SYNC` Constant corresponding to `dataSync` in the `https://developer.android.com/reference/android/R.attr#foregroundServiceType` attribute. |
| `int` | `https://developer.android.com/reference/android/content/pm/ServiceInfo#FOREGROUND_SERVICE_TYPE_HEALTH` Constant corresponding to `health` in the `https://developer.android.com/reference/android/R.attr#foregroundServiceType` attribute. |
| `int` | `https://developer.android.com/reference/android/content/pm/ServiceInfo#FOREGROUND_SERVICE_TYPE_LOCATION` Constant corresponding to `location` in the `https://developer.android.com/reference/android/R.attr#foregroundServiceType` attribute. |
| `int` | `https://developer.android.com/reference/android/content/pm/ServiceInfo#FOREGROUND_SERVICE_TYPE_MANIFEST` A special value indicates to use all types set in manifest file. |
| `int` | `https://developer.android.com/reference/android/content/pm/ServiceInfo#FOREGROUND_SERVICE_TYPE_MEDIA_PLAYBACK` Constant corresponding to `mediaPlayback` in the `https://developer.android.com/reference/android/R.attr#foregroundServiceType` attribute. |
| `int` | `https://developer.android.com/reference/android/content/pm/ServiceInfo#FOREGROUND_SERVICE_TYPE_MEDIA_PROCESSING` Constant corresponding to `mediaProcessing` in the `https://developer.android.com/reference/android/R.attr#foregroundServiceType` attribute. |
| `int` | `https://developer.android.com/reference/android/content/pm/ServiceInfo#FOREGROUND_SERVICE_TYPE_MEDIA_PROJECTION` Constant corresponding to `mediaProjection` in the `https://developer.android.com/reference/android/R.attr#foregroundServiceType` attribute. |
| `int` | `https://developer.android.com/reference/android/content/pm/ServiceInfo#FOREGROUND_SERVICE_TYPE_MICROPHONE` Constant corresponding to `microphone` in the `https://developer.android.com/reference/android/R.attr#foregroundServiceType` attribute. |
| `int` | `https://developer.android.com/reference/android/content/pm/ServiceInfo#FOREGROUND_SERVICE_TYPE_NONE` *This constant was deprecated in API level 34. Do not use.* |
| `int` | `https://developer.android.com/reference/android/content/pm/ServiceInfo#FOREGROUND_SERVICE_TYPE_PHONE_CALL` Constant corresponding to `phoneCall` in the `https://developer.android.com/reference/android/R.attr#foregroundServiceType` attribute. |
| `int` | `https://developer.android.com/reference/android/content/pm/ServiceInfo#FOREGROUND_SERVICE_TYPE_REMOTE_MESSAGING` Constant corresponding to `remoteMessaging` in the `https://developer.android.com/reference/android/R.attr#foregroundServiceType` attribute. |
| `int` | `https://developer.android.com/reference/android/content/pm/ServiceInfo#FOREGROUND_SERVICE_TYPE_SHORT_SERVICE` A foreground service type for "short-lived" services, which corresponds to `shortService` in the `https://developer.android.com/reference/android/R.attr#foregroundServiceType` attribute in the manifest. |
| `int` | `https://developer.android.com/reference/android/content/pm/ServiceInfo#FOREGROUND_SERVICE_TYPE_SPECIAL_USE` Constant corresponding to `specialUse` in the `https://developer.android.com/reference/android/R.attr#foregroundServiceType` attribute. |
| `int` | `https://developer.android.com/reference/android/content/pm/ServiceInfo#FOREGROUND_SERVICE_TYPE_SYSTEM_EXEMPTED` Constant corresponding to `systemExempted` in the `https://developer.android.com/reference/android/R.attr#foregroundServiceType` attribute. |

### Inherited constants

From interface `https://developer.android.com/reference/android/os/Parcelable` `int` `https://developer.android.com/reference/android/os/Parcelable#CONTENTS_FILE_DESCRIPTOR`

Descriptor bit used with `https://developer.android.com/reference/android/os/Parcelable#describeContents()`: indicates that the Parcelable object's flattened representation includes a file descriptor.
`int` `https://developer.android.com/reference/android/os/Parcelable#PARCELABLE_WRITE_RETURN_VALUE`

Flag for use with `https://developer.android.com/reference/android/os/Parcelable#writeToParcel(android.os.Parcel,%20int)`: the object being written is a return value, that is the result of a function such as "`Parcelable someFunction()`", "`void someFunction(out Parcelable)`", or "`void someFunction(inout Parcelable)`".

| ### Fields ||
|---|---|
| ` public static final https://developer.android.com/reference/android/os/Parcelable.Creator<https://developer.android.com/reference/android/content/pm/ServiceInfo>` | `https://developer.android.com/reference/android/content/pm/ServiceInfo#CREATOR` <br /> |
| ` public int` | `https://developer.android.com/reference/android/content/pm/ServiceInfo#flags` Options that have been set in the service declaration in the manifest. |
| ` public https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/content/pm/ServiceInfo#permission` Optional name of a permission required to be able to access this Service. |

### Inherited fields

From class `https://developer.android.com/reference/android/content/pm/ComponentInfo` ` public https://developer.android.com/reference/android/content/pm/ApplicationInfo` `https://developer.android.com/reference/android/content/pm/ComponentInfo#applicationInfo`

Global information about the application/package this component is a part of.
` public https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/pm/ComponentInfo#attributionTags`

Set of attribution tags that should be automatically applied to this component.
` public int` `https://developer.android.com/reference/android/content/pm/ComponentInfo#descriptionRes`

A string resource identifier (in the package's resources) containing a user-readable description of the component.
` public boolean` `https://developer.android.com/reference/android/content/pm/ComponentInfo#directBootAware`

Indicates if this component is aware of direct boot lifecycle, and can be safely run before the user has entered their credentials (such as a lock pattern or PIN).
` public boolean` `https://developer.android.com/reference/android/content/pm/ComponentInfo#enabled`

Indicates whether or not this component may be instantiated.
` public boolean` `https://developer.android.com/reference/android/content/pm/ComponentInfo#exported`

Set to true if this component is available for use by other applications.
` public https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/pm/ComponentInfo#processName`

The name of the process this component should run in.
` public https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/pm/ComponentInfo#splitName`

The name of the split in which this component is declared.
From class `https://developer.android.com/reference/android/content/pm/PackageItemInfo` ` public int` `https://developer.android.com/reference/android/content/pm/PackageItemInfo#banner`

A drawable resource identifier (in the package's resources) of this component's banner.
` public int` `https://developer.android.com/reference/android/content/pm/PackageItemInfo#icon`

A drawable resource identifier (in the package's resources) of this component's icon.
` public boolean` `https://developer.android.com/reference/android/content/pm/PackageItemInfo#isArchived`

Whether the package is currently in an archived state.
` public int` `https://developer.android.com/reference/android/content/pm/PackageItemInfo#labelRes`

A string resource identifier (in the package's resources) of this component's label.
` public int` `https://developer.android.com/reference/android/content/pm/PackageItemInfo#logo`

A drawable resource identifier (in the package's resources) of this component's logo.
` public https://developer.android.com/reference/android/os/Bundle` `https://developer.android.com/reference/android/content/pm/PackageItemInfo#metaData`

Additional meta-data associated with this component.
` public https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/pm/PackageItemInfo#name`

Public name of this item.
` public https://developer.android.com/reference/java/lang/CharSequence` `https://developer.android.com/reference/android/content/pm/PackageItemInfo#nonLocalizedLabel`

The string provided in the AndroidManifest file, if any.
` public https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/pm/PackageItemInfo#packageName`

Name of the package that this item is in.

| ### Public constructors ||
|---|---|
| ` https://developer.android.com/reference/android/content/pm/ServiceInfo#ServiceInfo()() ` |
| ` https://developer.android.com/reference/android/content/pm/ServiceInfo#ServiceInfo(android.content.pm.ServiceInfo)(https://developer.android.com/reference/android/content/pm/ServiceInfo orig) ` |

| ### Public methods ||
|---|---|
| ` int` | ` https://developer.android.com/reference/android/content/pm/ServiceInfo#describeContents()() ` Describe the kinds of special objects contained in this Parcelable instance's marshaled representation. |
| ` void` | ` https://developer.android.com/reference/android/content/pm/ServiceInfo#dump(android.util.Printer,%20java.lang.String)(https://developer.android.com/reference/android/util/Printer pw, https://developer.android.com/reference/java/lang/String prefix) ` |
| ` int` | ` https://developer.android.com/reference/android/content/pm/ServiceInfo#getForegroundServiceType()() ` Return foreground service type specified in the manifest.. |
| ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/android/content/pm/ServiceInfo#toString()() ` Returns a string representation of the object. |
| ` void` | ` https://developer.android.com/reference/android/content/pm/ServiceInfo#writeToParcel(android.os.Parcel,%20int)(https://developer.android.com/reference/android/os/Parcel dest, int parcelableFlags) ` <br /> |

### Inherited methods

From class ` https://developer.android.com/reference/android/content/pm/ComponentInfo ` ` void` ` https://developer.android.com/reference/android/content/pm/ComponentInfo#dumpBack(android.util.Printer,%20java.lang.String)(https://developer.android.com/reference/android/util/Printer pw, https://developer.android.com/reference/java/lang/String prefix) `

<br />

` void` ` https://developer.android.com/reference/android/content/pm/ComponentInfo#dumpFront(android.util.Printer,%20java.lang.String)(https://developer.android.com/reference/android/util/Printer pw, https://developer.android.com/reference/java/lang/String prefix) `

<br />

` final int` ` https://developer.android.com/reference/android/content/pm/ComponentInfo#getBannerResource()() `

Return the banner resource identifier to use for this component.
` final int` ` https://developer.android.com/reference/android/content/pm/ComponentInfo#getIconResource()() `

Return the icon resource identifier to use for this component.
` final int` ` https://developer.android.com/reference/android/content/pm/ComponentInfo#getLogoResource()() `

Return the logo resource identifier to use for this component.
` boolean` ` https://developer.android.com/reference/android/content/pm/ComponentInfo#isEnabled()() `

Return whether this component and its enclosing application are enabled.
` void` ` https://developer.android.com/reference/android/content/pm/ComponentInfo#writeToParcel(android.os.Parcel,%20int)(https://developer.android.com/reference/android/os/Parcel dest, int parcelableFlags) `

<br />

From class ` https://developer.android.com/reference/android/content/pm/PackageItemInfo ` ` void` ` https://developer.android.com/reference/android/content/pm/PackageItemInfo#dumpBack(android.util.Printer,%20java.lang.String)(https://developer.android.com/reference/android/util/Printer pw, https://developer.android.com/reference/java/lang/String prefix) ` ` void` ` https://developer.android.com/reference/android/content/pm/PackageItemInfo#dumpFront(android.util.Printer,%20java.lang.String)(https://developer.android.com/reference/android/util/Printer pw, https://developer.android.com/reference/java/lang/String prefix) ` ` https://developer.android.com/reference/android/graphics/drawable/Drawable` ` https://developer.android.com/reference/android/content/pm/PackageItemInfo#loadBanner(android.content.pm.PackageManager)(https://developer.android.com/reference/android/content/pm/PackageManager pm) `

Retrieve the current graphical banner associated with this item.
` https://developer.android.com/reference/android/graphics/drawable/Drawable` ` https://developer.android.com/reference/android/content/pm/PackageItemInfo#loadIcon(android.content.pm.PackageManager)(https://developer.android.com/reference/android/content/pm/PackageManager pm) `

Retrieve the current graphical icon associated with this item.
` https://developer.android.com/reference/java/lang/CharSequence` ` https://developer.android.com/reference/android/content/pm/PackageItemInfo#loadLabel(android.content.pm.PackageManager)(https://developer.android.com/reference/android/content/pm/PackageManager pm) `

Retrieve the current textual label associated with this item.
` https://developer.android.com/reference/android/graphics/drawable/Drawable` ` https://developer.android.com/reference/android/content/pm/PackageItemInfo#loadLogo(android.content.pm.PackageManager)(https://developer.android.com/reference/android/content/pm/PackageManager pm) `

Retrieve the current graphical logo associated with this item.
` https://developer.android.com/reference/android/graphics/drawable/Drawable` ` https://developer.android.com/reference/android/content/pm/PackageItemInfo#loadUnbadgedIcon(android.content.pm.PackageManager)(https://developer.android.com/reference/android/content/pm/PackageManager pm) `

Retrieve the current graphical icon associated with this item without the addition of a work badge if applicable.
` https://developer.android.com/reference/android/content/res/XmlResourceParser` ` https://developer.android.com/reference/android/content/pm/PackageItemInfo#loadXmlMetaData(android.content.pm.PackageManager,%20java.lang.String)(https://developer.android.com/reference/android/content/pm/PackageManager pm, https://developer.android.com/reference/java/lang/String name) `

Load an XML resource attached to the meta-data of this item.
` void` ` https://developer.android.com/reference/android/content/pm/PackageItemInfo#writeToParcel(android.os.Parcel,%20int)(https://developer.android.com/reference/android/os/Parcel dest, int parcelableFlags) ` From class ` https://developer.android.com/reference/java/lang/Object ` ` https://developer.android.com/reference/java/lang/Object` ` https://developer.android.com/reference/java/lang/Object#clone()() `

Creates and returns a copy of this object.
` boolean` ` https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object)(https://developer.android.com/reference/java/lang/Object obj) `

Indicates whether some other object is "equal to" this one.
` void` ` https://developer.android.com/reference/java/lang/Object#finalize()() `

Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.
` final https://developer.android.com/reference/java/lang/Class<?>` ` https://developer.android.com/reference/java/lang/Object#getClass()() `

Returns the runtime class of this `Object`.
` int` ` https://developer.android.com/reference/java/lang/Object#hashCode()() `

Returns a hash code value for the object.
` final void` ` https://developer.android.com/reference/java/lang/Object#notify()() `

Wakes up a single thread that is waiting on this object's monitor.
` final void` ` https://developer.android.com/reference/java/lang/Object#notifyAll()() `

Wakes up all threads that are waiting on this object's monitor.
` https://developer.android.com/reference/java/lang/String` ` https://developer.android.com/reference/java/lang/Object#toString()() `

Returns a string representation of the object.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait(long,%20int)(long timeoutMillis, int nanos) `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait(long)(long timeoutMillis) `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait()() `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*.
From interface ` https://developer.android.com/reference/android/os/Parcelable ` ` abstract int` ` https://developer.android.com/reference/android/os/Parcelable#describeContents()() `

Describe the kinds of special objects contained in this Parcelable instance's marshaled representation.
` abstract void` ` https://developer.android.com/reference/android/os/Parcelable#writeToParcel(android.os.Parcel,%20int)(https://developer.android.com/reference/android/os/Parcel dest, int flags) `

Flatten this object in to a Parcel.

## Constants

### FLAG_ALLOW_SHARED_ISOLATED_PROCESS

Added in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int FLAG_ALLOW_SHARED_ISOLATED_PROCESS
```

Bit in `https://developer.android.com/reference/android/content/pm/ServiceInfo#flags`: If set, and this is an `https://developer.android.com/reference/android/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 `https://developer.android.com/reference/android/content/Context#BIND_SHARED_ISOLATED_PROCESS` during service binding. Note that when this flag is used, the `https://developer.android.com/reference/android/R.attr#process` attribute is ignored when the process is bound into a shared isolated process by a client.

<br />

Constant Value: 16 (0x00000010)

### FLAG_EXTERNAL_SERVICE

Added in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int FLAG_EXTERNAL_SERVICE
```

Bit in `https://developer.android.com/reference/android/content/pm/ServiceInfo#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 `https://developer.android.com/reference/android/R.attr#externalService` attribute.

<br />

Constant Value: 4 (0x00000004)

### FLAG_ISOLATED_PROCESS

Added in [API level 16](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int FLAG_ISOLATED_PROCESS
```

Bit in `https://developer.android.com/reference/android/content/pm/ServiceInfo#flags`: If set, the service will run in its own isolated process. Set from the `https://developer.android.com/reference/android/R.attr#isolatedProcess` attribute.

<br />

Constant Value: 2 (0x00000002)

### FLAG_NATIVE_SERVICE

Added in [API level 37](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int FLAG_NATIVE_SERVICE
```

Bit in `https://developer.android.com/reference/android/content/pm/ServiceInfo#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 `https://developer.android.com/reference/android/content/pm/ServiceInfo#FLAG_ISOLATED_PROCESS` is false or isn't specified. Set from the `https://developer.android.com/reference/android/R.attr#nativeService` attribute.

<br />

Constant Value: 32 (0x00000020)

### FLAG_SINGLE_USER

Added in [API level 17](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int FLAG_SINGLE_USER
```

Bit in `https://developer.android.com/reference/android/content/pm/ServiceInfo#flags`: If set, a single instance of the service will run for all users on the device. Set from the `https://developer.android.com/reference/android/R.attr#singleUser` attribute.

<br />

Constant Value: 1073741824 (0x40000000)

### FLAG_STOP_WITH_TASK

Added in [API level 14](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int FLAG_STOP_WITH_TASK
```

Bit in `https://developer.android.com/reference/android/content/pm/ServiceInfo#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 `https://developer.android.com/reference/android/R.attr#stopWithTask` attribute.

<br />

Constant Value: 1 (0x00000001)

### FLAG_USE_APP_ZYGOTE

Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int FLAG_USE_APP_ZYGOTE
```

Bit in `https://developer.android.com/reference/android/content/pm/ServiceInfo#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.

<br />

Constant Value: 8 (0x00000008)

### FOREGROUND_SERVICE_TYPE_CAMERA

Added in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int FOREGROUND_SERVICE_TYPE_CAMERA
```

Constant corresponding to `camera` in the `https://developer.android.com/reference/android/R.attr#foregroundServiceType` attribute. Use the camera device or record video. For apps with `targetSdkVersion` `https://developer.android.com/reference/android/os/Build.VERSION_CODES#R` and above, a foreground service will not be able to access the camera if this type is not specified in the manifest and in `https://developer.android.com/reference/android/app/Service#startForeground(int,%20android.app.Notification,%20int)`.

Starting foreground service with this type from apps targeting API level `https://developer.android.com/reference/android/os/Build.VERSION_CODES#UPSIDE_DOWN_CAKE` and later, will require permission `https://developer.android.com/reference/android/Manifest.permission#FOREGROUND_SERVICE_CAMERA` and `https://developer.android.com/reference/android/Manifest.permission#CAMERA`.

<br />

Constant Value: 64 (0x00000040)

### FOREGROUND_SERVICE_TYPE_CONNECTED_DEVICE

Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int FOREGROUND_SERVICE_TYPE_CONNECTED_DEVICE
```

Constant corresponding to `connectedDevice` in the `https://developer.android.com/reference/android/R.attr#foregroundServiceType` attribute. Auto, bluetooth, TV or other devices connection, monitoring and interaction.

Starting foreground service with this type from apps targeting API level `https://developer.android.com/reference/android/os/Build.VERSION_CODES#UPSIDE_DOWN_CAKE` and later, will require permission `https://developer.android.com/reference/android/Manifest.permission#FOREGROUND_SERVICE_CONNECTED_DEVICE` and one of the following permissions: `https://developer.android.com/reference/android/Manifest.permission#BLUETOOTH_ADVERTISE`, `https://developer.android.com/reference/android/Manifest.permission#BLUETOOTH_CONNECT`, `https://developer.android.com/reference/android/Manifest.permission#BLUETOOTH_SCAN`, `https://developer.android.com/reference/android/Manifest.permission#CHANGE_NETWORK_STATE`, `https://developer.android.com/reference/android/Manifest.permission#CHANGE_WIFI_STATE`, `https://developer.android.com/reference/android/Manifest.permission#CHANGE_WIFI_MULTICAST_STATE`, `https://developer.android.com/reference/android/Manifest.permission#NFC`, `https://developer.android.com/reference/android/Manifest.permission#TRANSMIT_IR`, `https://developer.android.com/reference/android/Manifest.permission#UWB_RANGING`, `https://developer.android.com/reference/android/Manifest.permission#RANGING`, or has been granted the access to one of the attached USB devices/accessories.

<br />

Constant Value: 16 (0x00000010)

### FOREGROUND_SERVICE_TYPE_DATA_SYNC

Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int FOREGROUND_SERVICE_TYPE_DATA_SYNC
```

Constant corresponding to `dataSync` in the `https://developer.android.com/reference/android/R.attr#foregroundServiceType` attribute. Data(photo, file, account) upload/download, backup/restore, import/export, fetch, transfer over network between device and cloud.

This type has time limit of 6 hours starting from Android version `https://developer.android.com/reference/android/os/Build.VERSION_CODES#VANILLA_ICE_CREAM`. A foreground service of this type must be stopped within the timeout by `https://developer.android.com/reference/android/app/Service#stopSelf()`, `https://developer.android.com/reference/android/content/Context#stopService(android.content.Intent)` or their overloads). `https://developer.android.com/reference/android/app/Service#stopForeground(int)` will also work, which will demote the service to a "background" service, which will soon be stopped by the system.

If the service isn't stopped within the timeout, `https://developer.android.com/reference/android/app/Service#onTimeout(int,%20int)` will be called.

Also note, even though `https://developer.android.com/reference/android/content/pm/ServiceInfo#FOREGROUND_SERVICE_TYPE_DATA_SYNC` can be used on Android versions prior to `https://developer.android.com/reference/android/os/Build.VERSION_CODES#VANILLA_ICE_CREAM`, since `https://developer.android.com/reference/android/app/Service#onTimeout(int,%20int)` did not exist on such versions, it will never be called. Because of this, developers must make sure to stop the foreground service even if `https://developer.android.com/reference/android/app/Service#onTimeout(int,%20int)` is not called on such versions.

<br />

**See also:**

- `https://developer.android.com/reference/android/app/Service#onTimeout(int,%20int)`

Constant Value: 1 (0x00000001)

### FOREGROUND_SERVICE_TYPE_HEALTH

Added in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int FOREGROUND_SERVICE_TYPE_HEALTH
```

Constant corresponding to `health` in the `https://developer.android.com/reference/android/R.attr#foregroundServiceType` attribute. Health, wellness and fitness.

The caller app is required to have the permissions `https://developer.android.com/reference/android/Manifest.permission#FOREGROUND_SERVICE_HEALTH` and one of the following permissions: `https://developer.android.com/reference/android/Manifest.permission#ACTIVITY_RECOGNITION`, `https://developer.android.com/reference/android/Manifest.permission#HIGH_SAMPLING_RATE_SENSORS`. `https://developer.android.com/reference/android/health/connect/HealthPermissions#READ_HEART_RATE`, `https://developer.android.com/reference/android/health/connect/HealthPermissions#READ_SKIN_TEMPERATURE`, `https://developer.android.com/reference/android/health/connect/HealthPermissions#READ_OXYGEN_SATURATION`, `https://developer.android.com/reference/android/health/connect/HealthPermissions#READ_BLOOD_PRESSURE`, `https://developer.android.com/reference/android/health/connect/HealthPermissions#READ_HEART_RATE_VARIABILITY`, `https://developer.android.com/reference/android/health/connect/HealthPermissions#READ_RESPIRATORY_RATE`, `https://developer.android.com/reference/android/health/connect/HealthPermissions#READ_VO2_MAX`,.   

Requires `https://developer.android.com/reference/android/Manifest.permission#FOREGROUND_SERVICE_HEALTH`

<br />

Constant Value: 256 (0x00000100)

### FOREGROUND_SERVICE_TYPE_LOCATION

Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int FOREGROUND_SERVICE_TYPE_LOCATION
```

Constant corresponding to `location` in the `https://developer.android.com/reference/android/R.attr#foregroundServiceType` attribute. GPS, map, navigation location update.

Starting foreground service with this type from apps targeting API level `https://developer.android.com/reference/android/os/Build.VERSION_CODES#UPSIDE_DOWN_CAKE` and later, will require permission `https://developer.android.com/reference/android/Manifest.permission#FOREGROUND_SERVICE_LOCATION` and one of the following permissions: `https://developer.android.com/reference/android/Manifest.permission#ACCESS_COARSE_LOCATION`, `https://developer.android.com/reference/android/Manifest.permission#ACCESS_FINE_LOCATION`.

<br />

Constant Value: 8 (0x00000008)

### FOREGROUND_SERVICE_TYPE_MANIFEST

Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int FOREGROUND_SERVICE_TYPE_MANIFEST
```

A special value indicates to use all types set in manifest file.

<br />

Constant Value: -1 (0xffffffff)

### FOREGROUND_SERVICE_TYPE_MEDIA_PLAYBACK

Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int FOREGROUND_SERVICE_TYPE_MEDIA_PLAYBACK
```

Constant corresponding to `mediaPlayback` in the `https://developer.android.com/reference/android/R.attr#foregroundServiceType` attribute. Music, video, news or other media playback.

Starting foreground service with this type from apps targeting API level `https://developer.android.com/reference/android/os/Build.VERSION_CODES#UPSIDE_DOWN_CAKE` and later, will require permission `https://developer.android.com/reference/android/Manifest.permission#FOREGROUND_SERVICE_MEDIA_PLAYBACK`.

<br />

Constant Value: 2 (0x00000002)

### FOREGROUND_SERVICE_TYPE_MEDIA_PROCESSING

Added in [API level 35](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int FOREGROUND_SERVICE_TYPE_MEDIA_PROCESSING
```

Constant corresponding to `mediaProcessing` in the `https://developer.android.com/reference/android/R.attr#foregroundServiceType` attribute. Media processing use cases such as video or photo editing and processing. This type has time limit of 6 hours. A foreground service of this type must be stopped within the timeout by `https://developer.android.com/reference/android/app/Service#stopSelf()`, `https://developer.android.com/reference/android/content/Context#stopService(android.content.Intent)` or their overloads). `https://developer.android.com/reference/android/app/Service#stopForeground(int)` will also work, which will demote the service to a "background" service, which will soon be stopped by the system.

If the service isn't stopped within the timeout, `https://developer.android.com/reference/android/app/Service#onTimeout(int,%20int)` will be called.

Also note, even though `https://developer.android.com/reference/android/content/pm/ServiceInfo#FOREGROUND_SERVICE_TYPE_MEDIA_PROCESSING` was added in Android version `https://developer.android.com/reference/android/os/Build.VERSION_CODES#VANILLA_ICE_CREAM`, it can be also used on prior android versions (just like other new foreground service types can be used). However, because `https://developer.android.com/reference/android/app/Service#onTimeout(int,%20int)` did not exist on prior versions, it will never be called on such versions. Because of this, developers must make sure to stop the foreground service even if `https://developer.android.com/reference/android/app/Service#onTimeout(int,%20int)` is not called on such versions.   

Requires `https://developer.android.com/reference/android/Manifest.permission#FOREGROUND_SERVICE_MEDIA_PROCESSING`

<br />

**See also:**

- `https://developer.android.com/reference/android/app/Service#onTimeout(int,%20int)`

Constant Value: 8192 (0x00002000)

### FOREGROUND_SERVICE_TYPE_MEDIA_PROJECTION

Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int FOREGROUND_SERVICE_TYPE_MEDIA_PROJECTION
```

Constant corresponding to `mediaProjection` in the `https://developer.android.com/reference/android/R.attr#foregroundServiceType` attribute.

To capture through `https://developer.android.com/reference/android/media/projection/MediaProjection`, an app must start a foreground service with the type corresponding to this constant. This type should only be used for `https://developer.android.com/reference/android/media/projection/MediaProjection`. Capturing screen contents via `https://developer.android.com/reference/android/media/projection/MediaProjection#createVirtualDisplay(java.lang.String,%20int,%20int,%20int,%20int,%20android.view.Surface,%20android.hardware.display.VirtualDisplay.Callback,%20android.os.Handler)` conveniently allows recording, presenting screen contents into a meeting, taking screenshots, or several other scenarios.

Starting foreground service with this type from apps targeting API level `https://developer.android.com/reference/android/os/Build.VERSION_CODES#UPSIDE_DOWN_CAKE` and later, will require permission `https://developer.android.com/reference/android/Manifest.permission#FOREGROUND_SERVICE_MEDIA_PROJECTION`, and the user must have allowed the screen capture request from this app.

<br />

Constant Value: 32 (0x00000020)

### FOREGROUND_SERVICE_TYPE_MICROPHONE

Added in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int FOREGROUND_SERVICE_TYPE_MICROPHONE
```

Constant corresponding to `microphone` in the `https://developer.android.com/reference/android/R.attr#foregroundServiceType` attribute. Use the microphone device or record audio. For apps with `targetSdkVersion` `https://developer.android.com/reference/android/os/Build.VERSION_CODES#R` and above, a foreground service will not be able to access the microphone if this type is not specified in the manifest and in `https://developer.android.com/reference/android/app/Service#startForeground(int,%20android.app.Notification,%20int)`.

Starting foreground service with this type from apps targeting API level `https://developer.android.com/reference/android/os/Build.VERSION_CODES#UPSIDE_DOWN_CAKE` and later, will require permission `https://developer.android.com/reference/android/Manifest.permission#FOREGROUND_SERVICE_MICROPHONE` and one of the following permissions: `https://developer.android.com/reference/android/Manifest.permission#CAPTURE_AUDIO_OUTPUT`, `https://developer.android.com/reference/android/Manifest.permission#RECORD_AUDIO`.

<br />

Constant Value: 128 (0x00000080)

### FOREGROUND_SERVICE_TYPE_NONE

Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)   
Deprecated in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int FOREGROUND_SERVICE_TYPE_NONE
```

<br />

**This constant was deprecated in API level 34.**   

Do not use.

The default foreground service type if not been set in manifest file.

Apps targeting API level `https://developer.android.com/reference/android/os/Build.VERSION_CODES#UPSIDE_DOWN_CAKE` and later should NOT use this type, calling `https://developer.android.com/reference/android/app/Service#startForeground(int,%20android.app.Notification,%20int)` with this type will get a `https://developer.android.com/reference/android/app/InvalidForegroundServiceTypeException`.

<br />

<br />

Constant Value: 0 (0x00000000)

### FOREGROUND_SERVICE_TYPE_PHONE_CALL

Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int FOREGROUND_SERVICE_TYPE_PHONE_CALL
```

Constant corresponding to `phoneCall` in the `https://developer.android.com/reference/android/R.attr#foregroundServiceType` attribute. Ongoing operations related to phone calls, video conferencing, or similar interactive communication.

Starting foreground service with this type from apps targeting API level `https://developer.android.com/reference/android/os/Build.VERSION_CODES#UPSIDE_DOWN_CAKE` and later, will require permission `https://developer.android.com/reference/android/Manifest.permission#FOREGROUND_SERVICE_PHONE_CALL` and `https://developer.android.com/reference/android/Manifest.permission#MANAGE_OWN_CALLS` or holding the default `https://developer.android.com/reference/android/app/role/RoleManager#ROLE_DIALER`.

<br />

Constant Value: 4 (0x00000004)

### FOREGROUND_SERVICE_TYPE_REMOTE_MESSAGING

Added in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int FOREGROUND_SERVICE_TYPE_REMOTE_MESSAGING
```

Constant corresponding to `remoteMessaging` in the `https://developer.android.com/reference/android/R.attr#foregroundServiceType` attribute. Messaging use cases which host local server to relay messages across devices.   

Requires `https://developer.android.com/reference/android/Manifest.permission#FOREGROUND_SERVICE_REMOTE_MESSAGING`

<br />

Constant Value: 512 (0x00000200)

### FOREGROUND_SERVICE_TYPE_SHORT_SERVICE

Added in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int FOREGROUND_SERVICE_TYPE_SHORT_SERVICE
```

A foreground service type for "short-lived" services, which corresponds to `shortService` in the `https://developer.android.com/reference/android/R.attr#foregroundServiceType` attribute in the manifest.

Unlike other foreground service types, this type is not associated with a specific use case, and it will not require any special permissions (besides `https://developer.android.com/reference/android/Manifest.permission#FOREGROUND_SERVICE`). However, this type has the following restrictions.

- The type has a 3 minute timeout. A foreground service of this type must be stopped within the timeout by `https://developer.android.com/reference/android/app/Service#stopSelf()`, `https://developer.android.com/reference/android/content/Context#stopService(android.content.Intent)` or their overloads). `https://developer.android.com/reference/android/app/Service#stopForeground(int)` will also work, which will demote the service to a "background" service, which will soon be stopped by the system.

  If the service isn't stopped within the timeout, `https://developer.android.com/reference/android/app/Service#onTimeout(int)` will be called. Note, even when the system calls this callback, it will not stop the service automatically. You still need to stop the service using one of the aforementioned ways even when you get this callback.

  If the service is still not stopped after the callback, the app will be declared an ANR, after a short grace period of several seconds.
- A foreground service of this type cannot be made "sticky" (see `https://developer.android.com/reference/android/app/Service#START_STICKY`). That is, if an app is killed due to a crash or out-of memory while it's running a short foregorund-service, the system will not restart the service.
- Other foreground services cannot be started from short foreground services. Unlike other foreground service types, when an app is running in the background while only having a "short" foreground service, it's not allowed to start other foreground services, due to the restriction describe here: [\|s, and you can combine](https://developer.android.com/guide/components/foreground-services#background-start-restrictions>
  Restrictions on background starts
  </a>
  <li>
  You can combine multiple foreground services types with <code translate=)`https://developer.android.com/reference/android/content/pm/ServiceInfo#FOREGROUND_SERVICE_TYPE_SHORT_SERVICE`. with other types as well. However, `https://developer.android.com/reference/android/content/pm/ServiceInfo#FOREGROUND_SERVICE_TYPE_SHORT_SERVICE` is for situations where you have no other valid foreground services to use and the timeout is long enough for the task, and if you can use other types, there's no point using this type. For this reason, if `https://developer.android.com/reference/android/content/pm/ServiceInfo#FOREGROUND_SERVICE_TYPE_SHORT_SERVICE` is combined with other foreground service types, the system will simply ignore it, and as a result, none of the above restrictions will apply (e.g. there'll be no timeout).

Also note, even though `https://developer.android.com/reference/android/content/pm/ServiceInfo#FOREGROUND_SERVICE_TYPE_SHORT_SERVICE` was added on Android version `https://developer.android.com/reference/android/os/Build.VERSION_CODES#UPSIDE_DOWN_CAKE`, it can be also used on on prior android versions (just like other new foreground service types can be used). However, because `https://developer.android.com/reference/android/app/Service#onTimeout(int)` did not exist on prior versions, it will never called on such versions. Because of this, developers must make sure to stop the foreground service even if `https://developer.android.com/reference/android/app/Service#onTimeout(int)` is not called on such versions.

<br />

**See also:**

- `https://developer.android.com/reference/android/app/Service#onTimeout(int)`

Constant Value: 2048 (0x00000800)

### FOREGROUND_SERVICE_TYPE_SPECIAL_USE

Added in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int FOREGROUND_SERVICE_TYPE_SPECIAL_USE
```

Constant corresponding to `specialUse` in the `https://developer.android.com/reference/android/R.attr#foregroundServiceType` attribute. Use cases that can't be categorized into any other foreground service types, but also can't use `https://developer.android.com/reference/android/app/job/JobInfo.Builder` APIs.

The use of this foreground service type may be restricted. Additionally, apps must declare a service-level `https://developer.android.com/reference/android/content/pm/PackageManager#PROPERTY_SPECIAL_USE_FGS_SUBTYPE` in `AndroidManifest.xml` as a hint of what the exact use case here is. Here is an example:

```
 <uses-permission
     android:name="android.permission.FOREGROUND_SERVICE_SPECIAL_USE"
 />
 <service
     android:name=".MySpecialForegroundService"
     android:foregroundServiceType="specialUse">
     <property
         android:name="android.app.PROPERTY_SPECIAL_USE_FGS_SUBTYPE"
         android:value="foo"
     />
</service>
```
In a future release of Android, if the above foreground service type `foo` is supported by the platform, to offer the backward compatibility, the app could specify the `android:maxSdkVersion` attribute in the \<uses-permission\> section, and also add the foreground service type `foo` into the `android:foregroundServiceType`, therefore the same app could be installed in both platforms.

```
 <uses-permission
     android:name="android.permission.FOREGROUND_SERVICE_SPECIAL_USE"
     android:maxSdkVersion="last_sdk_version_without_type_foo"
 />
 <service
     android:name=".MySpecialForegroundService"
     android:foregroundServiceType="specialUse|foo">
     <property
         android:name="android.app.PROPERTY_SPECIAL_USE_FGS_SUBTYPE"
         android:value="foo"
     />
</service>
```
.   
Requires `https://developer.android.com/reference/android/Manifest.permission#FOREGROUND_SERVICE_SPECIAL_USE`

<br />

<br />

Constant Value: 1073741824 (0x40000000)

### FOREGROUND_SERVICE_TYPE_SYSTEM_EXEMPTED

Added in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int FOREGROUND_SERVICE_TYPE_SYSTEM_EXEMPTED
```

Constant corresponding to `systemExempted` in the `https://developer.android.com/reference/android/R.attr#foregroundServiceType` attribute. The system exempted foreground service use cases.

Note, apps are allowed to use this type only in the following cases:

- App has a UID \< `https://developer.android.com/reference/android/os/Process#FIRST_APPLICATION_UID`
- App is on Doze allowlist
- Device is running in [Demo Mode](https://android.googlesource.com/platform/frameworks/base/+/master/packages/SystemUI/docs/demo_mode.md)
- [Device owner app](https://source.android.com/devices/tech/admin/provision)
- [Profile owner apps](https://source.android.com/devices/tech/admin/managed-profiles)
- Persistent apps
- [Carrier privileged apps](https://source.android.com/docs/core/connect/carrier)
- Apps that have the `android.app.role.RoleManager#ROLE_EMERGENCY` role
- Headless system apps
- [Device admin apps](https://developer.android.com/guide/topics/admin/device-admin)
- Active VPN apps
- Apps holding `https://developer.android.com/reference/android/Manifest.permission#SCHEDULE_EXACT_ALARM` or `https://developer.android.com/reference/android/Manifest.permission#USE_EXACT_ALARM` permission.

<br />

.   
Requires `https://developer.android.com/reference/android/Manifest.permission#FOREGROUND_SERVICE_SYSTEM_EXEMPTED`

<br />

<br />

Constant Value: 1024 (0x00000400)

## Fields

### CREATOR

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final Creator<ServiceInfo> CREATOR
```

<br />

<br />

### flags

Added in [API level 14](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public int flags
```

Options that have been set in the service declaration in the manifest. These include: `https://developer.android.com/reference/android/content/pm/ServiceInfo#FLAG_STOP_WITH_TASK`, `https://developer.android.com/reference/android/content/pm/ServiceInfo#FLAG_ISOLATED_PROCESS`, `https://developer.android.com/reference/android/content/pm/ServiceInfo#FLAG_SINGLE_USER`, `https://developer.android.com/reference/android/content/pm/ServiceInfo#FLAG_NATIVE_SERVICE`.

<br />

### permission

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public String permission
```

Optional name of a permission required to be able to access this Service. From the "permission" attribute.

<br />

## Public constructors

### ServiceInfo

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public ServiceInfo ()
```

<br />

<br />

### ServiceInfo

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public ServiceInfo (ServiceInfo orig)
```

<br />

<br />

| Parameters ||
|---|---|
| `orig` | `ServiceInfo` <br /> |

## Public methods

### describeContents

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public int describeContents ()
```

Describe the kinds of special objects contained in this Parcelable instance's marshaled representation. For example, if the object will include a file descriptor in the output of `https://developer.android.com/reference/android/os/Parcelable#writeToParcel(android.os.Parcel,%20int)`, the return value of this method must include the `https://developer.android.com/reference/android/os/Parcelable#CONTENTS_FILE_DESCRIPTOR` bit.

<br />

| Returns ||
|---|---|
| `int` | a bitmask indicating the set of special object types marshaled by this Parcelable object instance. Value is either `0` or - `https://developer.android.com/reference/android/os/Parcelable#CONTENTS_FILE_DESCRIPTOR` |

### dump

Added in [API level 5](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void dump (Printer pw, 
                String prefix)
```

<br />

<br />

| Parameters ||
|---|---|
| `pw` | `Printer` <br /> |
| `prefix` | `String` <br /> |

### getForegroundServiceType

Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public int getForegroundServiceType ()
```

Return foreground service type specified in the manifest..

<br />

| Returns ||
|---|---|
| `int` | foreground service type specified in the manifest. Value is either `0` or a combination of the following: - `https://developer.android.com/reference/android/content/pm/ServiceInfo#FOREGROUND_SERVICE_TYPE_MANIFEST` - `https://developer.android.com/reference/android/content/pm/ServiceInfo#FOREGROUND_SERVICE_TYPE_NONE` - `https://developer.android.com/reference/android/content/pm/ServiceInfo#FOREGROUND_SERVICE_TYPE_DATA_SYNC` - `https://developer.android.com/reference/android/content/pm/ServiceInfo#FOREGROUND_SERVICE_TYPE_MEDIA_PLAYBACK` - `https://developer.android.com/reference/android/content/pm/ServiceInfo#FOREGROUND_SERVICE_TYPE_PHONE_CALL` - `https://developer.android.com/reference/android/content/pm/ServiceInfo#FOREGROUND_SERVICE_TYPE_LOCATION` - `https://developer.android.com/reference/android/content/pm/ServiceInfo#FOREGROUND_SERVICE_TYPE_CONNECTED_DEVICE` - `https://developer.android.com/reference/android/content/pm/ServiceInfo#FOREGROUND_SERVICE_TYPE_MEDIA_PROJECTION` - `https://developer.android.com/reference/android/content/pm/ServiceInfo#FOREGROUND_SERVICE_TYPE_CAMERA` - `https://developer.android.com/reference/android/content/pm/ServiceInfo#FOREGROUND_SERVICE_TYPE_MICROPHONE` - `https://developer.android.com/reference/android/content/pm/ServiceInfo#FOREGROUND_SERVICE_TYPE_HEALTH` - `https://developer.android.com/reference/android/content/pm/ServiceInfo#FOREGROUND_SERVICE_TYPE_REMOTE_MESSAGING` - `https://developer.android.com/reference/android/content/pm/ServiceInfo#FOREGROUND_SERVICE_TYPE_SYSTEM_EXEMPTED` - `https://developer.android.com/reference/android/content/pm/ServiceInfo#FOREGROUND_SERVICE_TYPE_SHORT_SERVICE` - `https://developer.android.com/reference/android/content/pm/ServiceInfo#FOREGROUND_SERVICE_TYPE_MEDIA_PROCESSING` - `https://developer.android.com/reference/android/content/pm/ServiceInfo#FOREGROUND_SERVICE_TYPE_SPECIAL_USE` |

### toString

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public String toString ()
```

Returns a string representation of the object.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | a string representation of the object. <br /> |

### writeToParcel

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void writeToParcel (Parcel dest, 
                int parcelableFlags)
```

<br />

<br />

| Parameters ||
|---|---|
| `dest` | `Parcel` <br /> |
| `parcelableFlags` | `int` <br /> |