Android APIs
public static class

ActivityManager.RunningAppProcessInfo

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

Class Overview

Information you can retrieve about a running process.

Summary

Constants
int IMPORTANCE_BACKGROUND Constant for importance: this process process contains background code that is expendable.
int IMPORTANCE_EMPTY Constant for importance: this process is empty of any actively running code.
int IMPORTANCE_FOREGROUND Constant for importance: this process is running the foreground UI.
int IMPORTANCE_PERCEPTIBLE Constant for importance: this process is running something that is considered to be actively perceptible to the user.
int IMPORTANCE_SERVICE Constant for importance: this process is contains services that should remain running.
int IMPORTANCE_VISIBLE Constant for importance: this process is running something that is actively visible to the user, though not in the immediate foreground.
int REASON_PROVIDER_IN_USE Constant for importanceReasonCode: one of the application's content providers is being used by another process.
int REASON_SERVICE_IN_USE Constant for importanceReasonCode: one of the application's content providers is being used by another process.
int REASON_UNKNOWN Constant for importanceReasonCode: nothing special has been specified for the reason for this level.
[Expand]
Inherited Constants
From interface android.os.Parcelable
Fields
public static final Creator<ActivityManager.RunningAppProcessInfo> CREATOR
public int importance The relative importance level that the system places on this process.
public int importanceReasonCode The reason for importance, if any.
public ComponentName importanceReasonComponent For the specified values of importanceReasonCode, this is the name of the component that is being used in this process.
public int importanceReasonPid For the specified values of importanceReasonCode, this is the process ID of the other process that is a client of this process.
public int lastTrimLevel Last memory trim level reported to the process: corresponds to the values supplied to ComponentCallbacks2.onTrimMemory(int).
public int lru An additional ordering within a particular importance category, providing finer-grained information about the relative utility of processes within a category.
public int pid The pid of this process; 0 if none
public String[] pkgList All packages that have been loaded into the process.
public String processName The name of the process that this object is associated with
public int uid The user id of this process.
Public Constructors
ActivityManager.RunningAppProcessInfo()
ActivityManager.RunningAppProcessInfo(String pProcessName, int pPid, String[] pArr)
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 IMPORTANCE_BACKGROUND

Added in API level 3

Constant for importance: this process process contains background code that is expendable.

Constant Value: 400 (0x00000190)

public static final int IMPORTANCE_EMPTY

Added in API level 3

Constant for importance: this process is empty of any actively running code.

Constant Value: 500 (0x000001f4)

public static final int IMPORTANCE_FOREGROUND

Added in API level 3

Constant for importance: this process is running the foreground UI.

Constant Value: 100 (0x00000064)

public static final int IMPORTANCE_PERCEPTIBLE

Added in API level 9

Constant for importance: this process is running something that is considered to be actively perceptible to the user. An example would be an application performing background music playback.

Constant Value: 130 (0x00000082)

public static final int IMPORTANCE_SERVICE

Added in API level 3

Constant for importance: this process is contains services that should remain running.

Constant Value: 300 (0x0000012c)

public static final int IMPORTANCE_VISIBLE

Added in API level 3

Constant for importance: this process is running something that is actively visible to the user, though not in the immediate foreground.

Constant Value: 200 (0x000000c8)

public static final int REASON_PROVIDER_IN_USE

Added in API level 5

Constant for importanceReasonCode: one of the application's content providers is being used by another process. The pid of the client process is in importanceReasonPid and the target provider in this process is in importanceReasonComponent.

Constant Value: 1 (0x00000001)

public static final int REASON_SERVICE_IN_USE

Added in API level 5

Constant for importanceReasonCode: one of the application's content providers is being used by another process. The pid of the client process is in importanceReasonPid and the target provider in this process is in importanceReasonComponent.

Constant Value: 2 (0x00000002)

public static final int REASON_UNKNOWN

Added in API level 5

Constant for importanceReasonCode: nothing special has been specified for the reason for this level.

Constant Value: 0 (0x00000000)

Fields

public static final Creator<ActivityManager.RunningAppProcessInfo> CREATOR

Added in API level 3

public int importance

Added in API level 3

The relative importance level that the system places on this process. May be one of IMPORTANCE_FOREGROUND, IMPORTANCE_VISIBLE, IMPORTANCE_SERVICE, IMPORTANCE_BACKGROUND, or IMPORTANCE_EMPTY. These constants are numbered so that "more important" values are always smaller than "less important" values.

public int importanceReasonCode

Added in API level 5

The reason for importance, if any.

public ComponentName importanceReasonComponent

Added in API level 5

For the specified values of importanceReasonCode, this is the name of the component that is being used in this process.

public int importanceReasonPid

Added in API level 5

For the specified values of importanceReasonCode, this is the process ID of the other process that is a client of this process. This will be 0 if no other process is using this one.

public int lastTrimLevel

Added in API level 16

Last memory trim level reported to the process: corresponds to the values supplied to ComponentCallbacks2.onTrimMemory(int).

public int lru

Added in API level 3

An additional ordering within a particular importance category, providing finer-grained information about the relative utility of processes within a category. This number means nothing except that a smaller values are more recently used (and thus more important). Currently an LRU value is only maintained for the IMPORTANCE_BACKGROUND category, though others may be maintained in the future.

public int pid

Added in API level 3

The pid of this process; 0 if none

public String[] pkgList

Added in API level 3

All packages that have been loaded into the process.

public String processName

Added in API level 3

The name of the process that this object is associated with

public int uid

Added in API level 5

The user id of this process.

Public Constructors

public ActivityManager.RunningAppProcessInfo ()

Added in API level 3

public ActivityManager.RunningAppProcessInfo (String pProcessName, int pPid, String[] pArr)

Added in API level 3

Public Methods

public int describeContents ()

Added in API level 3

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 3

public void writeToParcel (Parcel dest, int flags)

Added in API level 3

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.