to top
Android APIs
public static class

ActivityManager.RunningServiceInfo

extends Object
implements Parcelable
java.lang.Object
   ↳ android.app.ActivityManager.RunningServiceInfo

Class Overview

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

Summary

Constants
int FLAG_FOREGROUND Bit for flags: set if the service has asked to run as a foreground process.
int FLAG_PERSISTENT_PROCESS Bit for {@link #flags): set if the service is running in a persistent process.
int FLAG_STARTED Bit for flags: set if this service has been explicitly started.
int FLAG_SYSTEM_PROCESS Bit for {@link #flags): set if the service is running in a core system process.
[Expand]
Inherited Constants
From interface android.os.Parcelable
Fields
public static final Creator<ActivityManager.RunningServiceInfo> CREATOR
public long activeSince The time when the service was first made active, either by someone starting or binding to it.
public int clientCount Number of clients connected to the service.
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.
public String clientPackage For special services that are bound to by system code, this is the package that holds the binding.
public int crashCount Number of times the service's process has crashed while the service is running.
public int flags Running flags.
public boolean foreground Set to true if the service has asked to run as a foreground process.
public long lastActivityTime The time when there was last activity in the service (either explicit requests to start it or clients binding to it).
public int pid If non-zero, this is the process the service is running in.
public String process The name of the process this service runs in.
public long restarting If non-zero, this service is not currently running, but scheduled to restart at the given time.
public ComponentName service The service component.
public boolean started Set to true if this service has been explicitly started.
public int uid The UID that owns this service.
Public Constructors
ActivityManager.RunningServiceInfo()
Public Methods
int describeContents()
Describe the kinds of special objects contained in this Parcelable's marshalled representation.
void readFromParcel(Parcel source)
void writeToParcel(Parcel dest, int flags)
Flatten this object in to a Parcel.
[Expand]
Inherited Methods
From class java.lang.Object
From interface android.os.Parcelable

Constants

public static final int FLAG_FOREGROUND

Added in API level 5

Bit for flags: set if the service has asked to run as a foreground process.

Constant Value: 2 (0x00000002)

public static final int FLAG_PERSISTENT_PROCESS

Added in API level 5

Bit for {@link #flags): set if the service is running in a persistent process.

Constant Value: 8 (0x00000008)

public static final int FLAG_STARTED

Added in API level 5

Bit for flags: set if this service has been explicitly started.

Constant Value: 1 (0x00000001)

public static final int FLAG_SYSTEM_PROCESS

Added in API level 5

Bit for {@link #flags): set if the service is running in a core system process.

Constant Value: 4 (0x00000004)

Fields

public static final Creator<ActivityManager.RunningServiceInfo> CREATOR

Added in API level 1

public long activeSince

Added in API level 1

The time when the service was first made active, either by someone starting or binding to it. This is in units of elapsedRealtime().

public int clientCount

Added in API level 1

Number of clients connected to the service.

public int clientLabel

Added in API level 5

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 String clientPackage

Added in API level 5

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

public int crashCount

Added in API level 1

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

public int flags

Added in API level 5

Running flags.

public boolean foreground

Added in API level 1

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

public long lastActivityTime

Added in API level 1

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 uptimeMillis().

public int pid

Added in API level 1

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

public String process

Added in API level 1

The name of the process this service runs in.

public long restarting

Added in API level 1

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

public ComponentName service

Added in API level 1

The service component.

public boolean started

Added in API level 1

Set to true if this service has been explicitly started.

public int uid

Added in API level 5

The UID that owns this service.

Public Constructors

public ActivityManager.RunningServiceInfo ()

Added in API level 1

Public Methods

public int describeContents ()

Added in API level 1

Describe the kinds of special objects contained in this Parcelable's marshalled representation.

Returns
  • a bitmask indicating the set of special object types marshalled by the Parcelable.

public void readFromParcel (Parcel source)

Added in API level 1

public void writeToParcel (Parcel dest, int flags)

Added in API level 1

Flatten this object in to a Parcel.

Parameters
dest The Parcel in which the object should be written.
flags Additional flags about how the object should be written. May be 0 or PARCELABLE_WRITE_RETURN_VALUE.