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

# ActivityManager.RunningServiceInfo

*** ** * ** ***

` public static class ActivityManager.RunningServiceInfo `   
` extends https://developer.android.com/reference/java/lang/Object ` ` implements https://developer.android.com/reference/android/os/Parcelable `

|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) ||
| ↳ | android.app.ActivityManager.RunningServiceInfo |

<br />

*** ** * ** ***

Information you can retrieve about a particular Service that is currently running in the system.

## Summary

| ### Constants ||
|---|---|
| `int` | `https://developer.android.com/reference/android/app/ActivityManager.RunningServiceInfo#FLAG_FOREGROUND` Bit for `https://developer.android.com/reference/android/app/ActivityManager.RunningServiceInfo#flags`: set if the service has asked to run as a foreground process. |
| `int` | `https://developer.android.com/reference/android/app/ActivityManager.RunningServiceInfo#FLAG_PERSISTENT_PROCESS` Bit for `https://developer.android.com/reference/android/app/ActivityManager.RunningServiceInfo#flags`: set if the service is running in a persistent process. |
| `int` | `https://developer.android.com/reference/android/app/ActivityManager.RunningServiceInfo#FLAG_STARTED` Bit for `https://developer.android.com/reference/android/app/ActivityManager.RunningServiceInfo#flags`: set if this service has been explicitly started. |
| `int` | `https://developer.android.com/reference/android/app/ActivityManager.RunningServiceInfo#FLAG_SYSTEM_PROCESS` Bit for `https://developer.android.com/reference/android/app/ActivityManager.RunningServiceInfo#flags`: set if the service is running in a core system process. |

### 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/app/ActivityManager.RunningServiceInfo>` | `https://developer.android.com/reference/android/app/ActivityManager.RunningServiceInfo#CREATOR` <br /> |
| ` public long` | `https://developer.android.com/reference/android/app/ActivityManager.RunningServiceInfo#activeSince` The time when the service was first made active, either by someone starting or binding to it. |
| ` public int` | `https://developer.android.com/reference/android/app/ActivityManager.RunningServiceInfo#clientCount` Number of clients connected to the service. |
| ` public int` | `https://developer.android.com/reference/android/app/ActivityManager.RunningServiceInfo#clientLabel` For special services that are bound to by system code, this is a string resource providing a user-visible label for who the client is. |
| ` public https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/app/ActivityManager.RunningServiceInfo#clientPackage` For special services that are bound to by system code, this is the package that holds the binding. |
| ` public int` | `https://developer.android.com/reference/android/app/ActivityManager.RunningServiceInfo#crashCount` Number of times the service's process has crashed while the service is running. |
| ` public int` | `https://developer.android.com/reference/android/app/ActivityManager.RunningServiceInfo#flags` Running flags. |
| ` public boolean` | `https://developer.android.com/reference/android/app/ActivityManager.RunningServiceInfo#foreground` Set to true if the service has asked to run as a foreground process. |
| ` public long` | `https://developer.android.com/reference/android/app/ActivityManager.RunningServiceInfo#lastActivityTime` The time when there was last activity in the service (either explicit requests to start it or clients binding to it). |
| ` public int` | `https://developer.android.com/reference/android/app/ActivityManager.RunningServiceInfo#pid` If non-zero, this is the process the service is running in. |
| ` public https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/app/ActivityManager.RunningServiceInfo#process` The name of the process this service runs in. |
| ` public long` | `https://developer.android.com/reference/android/app/ActivityManager.RunningServiceInfo#restarting` If non-zero, this service is not currently running, but scheduled to restart at the given time. |
| ` public https://developer.android.com/reference/android/content/ComponentName` | `https://developer.android.com/reference/android/app/ActivityManager.RunningServiceInfo#service` The service component. |
| ` public boolean` | `https://developer.android.com/reference/android/app/ActivityManager.RunningServiceInfo#started` Set to true if this service has been explicitly started. |
| ` public int` | `https://developer.android.com/reference/android/app/ActivityManager.RunningServiceInfo#uid` The UID that owns this service. |

| ### Public constructors ||
|---|---|
| ` https://developer.android.com/reference/android/app/ActivityManager.RunningServiceInfo#RunningServiceInfo()() ` |

| ### Public methods ||
|---|---|
| ` int` | ` https://developer.android.com/reference/android/app/ActivityManager.RunningServiceInfo#describeContents()() ` Describe the kinds of special objects contained in this Parcelable instance's marshaled representation. |
| ` void` | ` https://developer.android.com/reference/android/app/ActivityManager.RunningServiceInfo#readFromParcel(android.os.Parcel)(https://developer.android.com/reference/android/os/Parcel source) ` |
| ` void` | ` https://developer.android.com/reference/android/app/ActivityManager.RunningServiceInfo#writeToParcel(android.os.Parcel,%20int)(https://developer.android.com/reference/android/os/Parcel dest, int flags) ` Flatten this object in to a Parcel. |

### Inherited methods

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_FOREGROUND

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

```
public static final int FLAG_FOREGROUND
```

Bit for `https://developer.android.com/reference/android/app/ActivityManager.RunningServiceInfo#flags`: set if the service has asked to run as a foreground process.

<br />

Constant Value: 2 (0x00000002)

### FLAG_PERSISTENT_PROCESS

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

```
public static final int FLAG_PERSISTENT_PROCESS
```

Bit for `https://developer.android.com/reference/android/app/ActivityManager.RunningServiceInfo#flags`: set if the service is running in a persistent process.

<br />

Constant Value: 8 (0x00000008)

### FLAG_STARTED

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

```
public static final int FLAG_STARTED
```

Bit for `https://developer.android.com/reference/android/app/ActivityManager.RunningServiceInfo#flags`: set if this service has been explicitly started.

<br />

Constant Value: 1 (0x00000001)

### FLAG_SYSTEM_PROCESS

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

```
public static final int FLAG_SYSTEM_PROCESS
```

Bit for `https://developer.android.com/reference/android/app/ActivityManager.RunningServiceInfo#flags`: set if the service is running in a core system process.

<br />

Constant Value: 4 (0x00000004)

## Fields

### CREATOR

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

```
public static final Creator<ActivityManager.RunningServiceInfo> CREATOR
```

<br />

<br />

### activeSince

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

```
public long activeSince
```

The time when the service was first made active, either by someone starting or binding to it. This is in units of `https://developer.android.com/reference/android/os/SystemClock#elapsedRealtime()`.

<br />

### clientCount

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

```
public int clientCount
```

Number of clients connected to the service.

<br />

### clientLabel

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

```
public int clientLabel
```

For special services that are bound to by system code, this is a string resource providing a user-visible label for who the client is.

<br />

### clientPackage

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

```
public String clientPackage
```

For special services that are bound to by system code, this is the package that holds the binding.

<br />

### crashCount

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

```
public int crashCount
```

Number of times the service's process has crashed while the service is running.

<br />

### flags

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

```
public int flags
```

Running flags.

<br />

### foreground

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

```
public boolean foreground
```

Set to true if the service has asked to run as a foreground process.

<br />

### lastActivityTime

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

```
public long lastActivityTime
```

The time when there was last activity in the service (either explicit requests to start it or clients binding to it). This is in units of `https://developer.android.com/reference/android/os/SystemClock#uptimeMillis()`.

<br />

### pid

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

```
public int pid
```

If non-zero, this is the process the service is running in.

<br />

### process

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

```
public String process
```

The name of the process this service runs in.

<br />

### restarting

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

```
public long restarting
```

If non-zero, this service is not currently running, but scheduled to restart at the given time.

<br />

### service

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

```
public ComponentName service
```

The service component.

<br />

### started

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

```
public boolean started
```

Set to true if this service has been explicitly started.

<br />

### uid

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

```
public int uid
```

The UID that owns this service.

<br />

## Public constructors

### RunningServiceInfo

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

```
public RunningServiceInfo ()
```

<br />

<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` |

### readFromParcel

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

```
public void readFromParcel (Parcel source)
```

<br />

<br />

| Parameters ||
|---|---|
| `source` | `Parcel` <br /> |

### writeToParcel

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

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

Flatten this object in to a Parcel.

<br />

| Parameters ||
|---|---|
| `dest` | `Parcel`: The Parcel in which the object should be written. This value cannot be `null`. <br /> |
| `flags` | `int`: Additional flags about how the object should be written. May be 0 or `https://developer.android.com/reference/android/os/Parcelable#PARCELABLE_WRITE_RETURN_VALUE`. Value is either `0` or a combination of the following: - `https://developer.android.com/reference/android/os/Parcelable#PARCELABLE_WRITE_RETURN_VALUE` |