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

# RunningServiceInfo

*** ** * ** ***

Kotlin \|[Java](https://developer.android.com/reference/android/app/ActivityManager.RunningServiceInfo "View this page in Java")

```
open class RunningServiceInfo : Parcelable
```

|---|---|
| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) ||
| ↳ | [android.app.ActivityManager.RunningServiceInfo](https://developer.android.com/reference/kotlin/android/app/ActivityManager.RunningServiceInfo#) |

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

## Summary

| Constants ||
|---|---|
| static [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | `https://developer.android.com/reference/kotlin/android/app/ActivityManager.RunningServiceInfo#FLAG_FOREGROUND:kotlin.Int` Bit for `https://developer.android.com/reference/kotlin/android/app/ActivityManager.RunningServiceInfo#flags:kotlin.Int`: set if the service has asked to run as a foreground process. |
| static [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | `https://developer.android.com/reference/kotlin/android/app/ActivityManager.RunningServiceInfo#FLAG_PERSISTENT_PROCESS:kotlin.Int` Bit for `https://developer.android.com/reference/kotlin/android/app/ActivityManager.RunningServiceInfo#flags:kotlin.Int`: set if the service is running in a persistent process. |
| static [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | `https://developer.android.com/reference/kotlin/android/app/ActivityManager.RunningServiceInfo#FLAG_STARTED:kotlin.Int` Bit for `https://developer.android.com/reference/kotlin/android/app/ActivityManager.RunningServiceInfo#flags:kotlin.Int`: set if this service has been explicitly started. |
| static [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | `https://developer.android.com/reference/kotlin/android/app/ActivityManager.RunningServiceInfo#FLAG_SYSTEM_PROCESS:kotlin.Int` Bit for `https://developer.android.com/reference/kotlin/android/app/ActivityManager.RunningServiceInfo#flags:kotlin.Int`: set if the service is running in a core system process. |

| Inherited constants ||
|---|---|
| From class `https://developer.android.com/reference/kotlin/android/os/Parcelable.html#` |---|---| | `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/android/os/Parcelable.html#CONTENTS_FILE_DESCRIPTOR:kotlin.Int` Descriptor bit used with `https://developer.android.com/reference/kotlin/android/os/Parcelable.html#describeContents()`: indicates that the Parcelable object's flattened representation includes a file descriptor. <br /> | | `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/android/os/Parcelable.html#PARCELABLE_WRITE_RETURN_VALUE:kotlin.Int` Flag for use with `https://developer.android.com/reference/kotlin/android/os/Parcelable.html#writeToParcel(android.os.Parcel,%20kotlin.Int)`: 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)`". Some implementations may want to release resources at this point. <br /> | ||

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

| Public methods ||
|---|---|
| open [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | `https://developer.android.com/reference/kotlin/android/app/ActivityManager.RunningServiceInfo#describeContents()()` Describe the kinds of special objects contained in this Parcelable instance's marshaled representation. |
| open [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | `https://developer.android.com/reference/kotlin/android/app/ActivityManager.RunningServiceInfo#readFromParcel(android.os.Parcel)(source: https://developer.android.com/reference/kotlin/android/os/Parcel.html#!)` <br /> |
| open [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | `https://developer.android.com/reference/kotlin/android/app/ActivityManager.RunningServiceInfo#writeToParcel(android.os.Parcel,%20kotlin.Int)(dest: https://developer.android.com/reference/kotlin/android/os/Parcel.html#, flags: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)` Flatten this object in to a Parcel. |

| Properties ||
|---|---|
| static [Parcelable.Creator](https://developer.android.com/reference/kotlin/android/os/Parcelable.Creator.html#)\<[ActivityManager.RunningServiceInfo](https://developer.android.com/reference/kotlin/android/app/ActivityManager.RunningServiceInfo#)!\> | `https://developer.android.com/reference/kotlin/android/app/ActivityManager.RunningServiceInfo#CREATOR:android.os.Parcelable.Creator` <br /> |
| [Long](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html) | `https://developer.android.com/reference/kotlin/android/app/ActivityManager.RunningServiceInfo#activeSince:kotlin.Long` The time when the service was first made active, either by someone starting or binding to it. |
| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | `https://developer.android.com/reference/kotlin/android/app/ActivityManager.RunningServiceInfo#clientCount:kotlin.Int` Number of clients connected to the service. |
| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | `https://developer.android.com/reference/kotlin/android/app/ActivityManager.RunningServiceInfo#clientLabel:kotlin.Int` 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. |
| [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)! | `https://developer.android.com/reference/kotlin/android/app/ActivityManager.RunningServiceInfo#clientPackage:kotlin.String` For special services that are bound to by system code, this is the package that holds the binding. |
| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | `https://developer.android.com/reference/kotlin/android/app/ActivityManager.RunningServiceInfo#crashCount:kotlin.Int` Number of times the service's process has crashed while the service is running. |
| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | `https://developer.android.com/reference/kotlin/android/app/ActivityManager.RunningServiceInfo#flags:kotlin.Int` Running flags. |
| [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) | `https://developer.android.com/reference/kotlin/android/app/ActivityManager.RunningServiceInfo#foreground:kotlin.Boolean` Set to true if the service has asked to run as a foreground process. |
| [Long](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html) | `https://developer.android.com/reference/kotlin/android/app/ActivityManager.RunningServiceInfo#lastActivityTime:kotlin.Long` The time when there was last activity in the service (either explicit requests to start it or clients binding to it). |
| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | `https://developer.android.com/reference/kotlin/android/app/ActivityManager.RunningServiceInfo#pid:kotlin.Int` If non-zero, this is the process the service is running in. |
| [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)! | `https://developer.android.com/reference/kotlin/android/app/ActivityManager.RunningServiceInfo#process:kotlin.String` The name of the process this service runs in. |
| [Long](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html) | `https://developer.android.com/reference/kotlin/android/app/ActivityManager.RunningServiceInfo#restarting:kotlin.Long` If non-zero, this service is not currently running, but scheduled to restart at the given time. |
| [ComponentName](https://developer.android.com/reference/kotlin/android/content/ComponentName.html#)! | `https://developer.android.com/reference/kotlin/android/app/ActivityManager.RunningServiceInfo#service:android.content.ComponentName` The service component. |
| [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) | `https://developer.android.com/reference/kotlin/android/app/ActivityManager.RunningServiceInfo#started:kotlin.Boolean` Set to true if this service has been explicitly started. |
| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | `https://developer.android.com/reference/kotlin/android/app/ActivityManager.RunningServiceInfo#uid:kotlin.Int` The UID that owns this service. |

## Constants

### FLAG_FOREGROUND

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

```
static val FLAG_FOREGROUND: Int
```

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

    Value: 2

### FLAG_PERSISTENT_PROCESS

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

```
static val FLAG_PERSISTENT_PROCESS: Int
```

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

    Value: 8

### FLAG_STARTED

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

```
static val FLAG_STARTED: Int
```

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

    Value: 1

### FLAG_SYSTEM_PROCESS

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

```
static val FLAG_SYSTEM_PROCESS: Int
```

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

    Value: 4

## Public constructors

### RunningServiceInfo

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

```
RunningServiceInfo()
```

## Public methods

### describeContents

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

```
open fun describeContents(): Int
```

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/kotlin/android/os/Parcelable.html#writeToParcel(android.os.Parcel,%20kotlin.Int)`, the return value of this method must include the `https://developer.android.com/reference/kotlin/android/os/Parcelable.html#CONTENTS_FILE_DESCRIPTOR:kotlin.Int` bit.

| Return ||
|---|---|
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html` | 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/kotlin/android/os/Parcelable.html#CONTENTS_FILE_DESCRIPTOR:kotlin.Int` |

### readFromParcel

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

```
open fun readFromParcel(source: Parcel!): Unit
```

### writeToParcel

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

```
open fun writeToParcel(
    dest: Parcel, 
    flags: Int
): Unit
```

Flatten this object in to a Parcel.

| Parameters ||
|---|---|
| `dest` | [Parcel](https://developer.android.com/reference/kotlin/android/os/Parcel.html#): The Parcel in which the object should be written. This value cannot be `null`. |
| `flags` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html): Additional flags about how the object should be written. May be 0 or `https://developer.android.com/reference/kotlin/android/os/Parcelable.html#PARCELABLE_WRITE_RETURN_VALUE:kotlin.Int`. Value is either `0` or a combination of the following: - `https://developer.android.com/reference/kotlin/android/os/Parcelable.html#PARCELABLE_WRITE_RETURN_VALUE:kotlin.Int` |

## Properties

### CREATOR

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

```
static val CREATOR: Parcelable.Creator<ActivityManager.RunningServiceInfo!>
```

### activeSince

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

```
var activeSince: Long
```

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/kotlin/android/os/SystemClock.html#elapsedRealtime()`.

### clientCount

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

```
var clientCount: Int
```

Number of clients connected to the service.

### clientLabel

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

```
var clientLabel: Int
```

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.

### clientPackage

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

```
var clientPackage: String!
```

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

### crashCount

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

```
var crashCount: Int
```

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

### flags

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

```
var flags: Int
```

Running flags.

### foreground

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

```
var foreground: Boolean
```

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

### lastActivityTime

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

```
var lastActivityTime: Long
```

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/kotlin/android/os/SystemClock.html#uptimeMillis()`.

### pid

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

```
var pid: Int
```

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

### process

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

```
var process: String!
```

The name of the process this service runs in.

### restarting

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

```
var restarting: Long
```

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

### service

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

```
var service: ComponentName!
```

The service component.

### started

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

```
var started: Boolean
```

Set to true if this service has been explicitly started.

### uid

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

```
var uid: Int
```

The UID that owns this service.