ActivityManager.RunningServiceInfo  |  API reference  |  Android Developers


public static class ActivityManager.RunningServiceInfo
extends Object implements Parcelable



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 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 flags: set if the service is running in a core system process.

Inherited constants

From interface android.os.Parcelable

int CONTENTS_FILE_DESCRIPTOR

Descriptor bit used with describeContents(): indicates that the Parcelable object's flattened representation includes a file descriptor.

int PARCELABLE_WRITE_RETURN_VALUE

Flag for use with writeToParcel(Parcel, 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)".

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

RunningServiceInfo()

Public methods

int describeContents()

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

void readFromParcel(Parcel source)
void writeToParcel(Parcel dest, int flags)

Flatten this object in to a Parcel.

Inherited methods

From class java.lang.Object

Object clone()

Creates and returns a copy of this object.

boolean equals(Object obj)

Indicates whether some other object is "equal to" this one.

void finalize()

Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.

final Class<?> getClass()

Returns the runtime class of this Object.

int hashCode()

Returns a hash code value for the object.

final void notify()

Wakes up a single thread that is waiting on this object's monitor.

final void notifyAll()

Wakes up all threads that are waiting on this object's monitor.

String toString()

Returns a string representation of the object.

final void wait(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 wait(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 wait()

Causes the current thread to wait until it is awakened, typically by being notified or interrupted.

From interface android.os.Parcelable

abstract int describeContents()

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

abstract void writeToParcel(Parcel dest, int flags)

Flatten this object in to a Parcel.

Constants

FLAG_FOREGROUND

public static final int FLAG_FOREGROUND

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

Constant Value: 2 (0x00000002)

FLAG_PERSISTENT_PROCESS

public static final int FLAG_PERSISTENT_PROCESS

Bit for flags: set if the service is running in a persistent process.

Constant Value: 8 (0x00000008)

FLAG_STARTED

public static final int FLAG_STARTED

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

Constant Value: 1 (0x00000001)

FLAG_SYSTEM_PROCESS

public static final int FLAG_SYSTEM_PROCESS

Bit for flags: set if the service is running in a core system process.

Constant Value: 4 (0x00000004)

Fields

activeSince

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 SystemClock.elapsedRealtime().

clientCount

public int clientCount

Number of clients connected to the service.

clientLabel

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.

clientPackage

public String clientPackage

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

crashCount

public int crashCount

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

flags

public int flags

Running flags.

foreground

public boolean foreground

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

lastActivityTime

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

pid

public int pid

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

process

public String process

The name of the process this service runs in.

restarting

public long restarting

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

started

public boolean started

Set to true if this service has been explicitly started.

uid

public int uid

The UID that owns this service.

Public constructors

RunningServiceInfo

public RunningServiceInfo ()

Public methods

describeContents

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 writeToParcel(Parcel,int), the return value of this method must include the CONTENTS_FILE_DESCRIPTOR bit.

Returns
int a bitmask indicating the set of special object types marshaled by this Parcelable object instance.
Value is either 0 or

readFromParcel

public void readFromParcel (Parcel source)
Parameters
source Parcel