Added in API level 3

RunningAppProcessInfo


open class RunningAppProcessInfo : Parcelable
kotlin.Any
   ↳ android.app.ActivityManager.RunningAppProcessInfo

Information you can retrieve about a running process.

Summary

Constants
static Int

static Int

Constant for importance: This process contains cached code that is expendable, not actively running any app components we care about.

static Int

Constant for importance: This process is running an application that can not save its state, and thus can't be killed while in the background.

static Int

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

static Int

Constant for importance: This process is running the foreground UI; that is, it is the thing currently at the top of the screen that the user is interacting with.

static Int

Constant for importance: This process is running a foreground service, for example to perform music playback even while the user is not immediately in the app.

static Int

Constant for importance: This process does not exist.

static Int

Constant for importance: This process is not something the user is directly aware of, but is otherwise perceptible to them to some degree.

static Int

Constant for importance: IMPORTANCE_PERCEPTIBLE had this wrong value before Build.VERSION_CODES.O.

static Int

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

static Int

Constant for importance: This process is running the foreground UI, but the device is asleep so it is not visible to the user.

static Int

static Int

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

static Int

Constant for importanceReasonCode: one of the application's content providers is being used by another process.

static Int

Constant for importanceReasonCode: one of the application's content providers is being used by another process.

static Int

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

Inherited constants
Public constructors

RunningAppProcessInfo(pProcessName: String!, pPid: Int, pArr: Array<String!>!)

Public methods
open Int

open Unit

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

Properties
static Parcelable.Creator<ActivityManager.RunningAppProcessInfo!>

Int

The relative importance level that the system places on this process.

Int

The reason for importance, if any.

ComponentName!

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

Int

For the specified values of importanceReasonCode, this is the process ID of the other process that is a client of this process.

Int

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

Int

An additional ordering within a particular importance category, providing finer-grained information about the relative utility of processes within a category.

Int

The pid of this process; 0 if none

Array<String!>!

All packages that have been loaded into the process.

String!

The name of the process that this object is associated with

Int

The user id of this process.

Constants

IMPORTANCE_BACKGROUND

Added in API level 3
Deprecated in API level 26
static val IMPORTANCE_BACKGROUND: Int

Deprecated: Renamed to IMPORTANCE_CACHED.

Value: 400

IMPORTANCE_CACHED

Added in API level 26
static val IMPORTANCE_CACHED: Int

Constant for importance: This process contains cached code that is expendable, not actively running any app components we care about.

Value: 400

IMPORTANCE_CANT_SAVE_STATE

Added in API level 28
static val IMPORTANCE_CANT_SAVE_STATE: Int

Constant for importance: This process is running an application that can not save its state, and thus can't be killed while in the background. This will be used with apps that have android.R.attr#cantSaveState set on their application tag.

Value: 350

IMPORTANCE_EMPTY

Added in API level 3
Deprecated in API level 26
static val IMPORTANCE_EMPTY: Int

Deprecated: This value is no longer reported, use IMPORTANCE_CACHED instead.

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

Value: 500

IMPORTANCE_FOREGROUND

Added in API level 3
static val IMPORTANCE_FOREGROUND: Int

Constant for importance: This process is running the foreground UI; that is, it is the thing currently at the top of the screen that the user is interacting with.

Value: 100

IMPORTANCE_FOREGROUND_SERVICE

Added in API level 23
static val IMPORTANCE_FOREGROUND_SERVICE: Int

Constant for importance: This process is running a foreground service, for example to perform music playback even while the user is not immediately in the app. This generally indicates that the process is doing something the user actively cares about.

Value: 125

IMPORTANCE_GONE

Added in API level 21
static val IMPORTANCE_GONE: Int

Constant for importance: This process does not exist.

Value: 1000

IMPORTANCE_PERCEPTIBLE

Added in API level 9
static val IMPORTANCE_PERCEPTIBLE: Int

Constant for importance: This process is not something the user is directly aware of, but is otherwise perceptible to them to some degree.

Value: 230

IMPORTANCE_PERCEPTIBLE_PRE_26

Added in API level 26
static val IMPORTANCE_PERCEPTIBLE_PRE_26: Int

Constant for importance: IMPORTANCE_PERCEPTIBLE had this wrong value before Build.VERSION_CODES.O. Since the Build.VERSION_CODES.O SDK, the value of IMPORTANCE_PERCEPTIBLE has been fixed.

The system will return this value instead of IMPORTANCE_PERCEPTIBLE on Android versions below Build.VERSION_CODES.O.

On Android version Build.VERSION_CODES.O and later, this value will still be returned for apps with the target API level below Build.VERSION_CODES.O. For apps targeting version Build.VERSION_CODES.O and later, the correct value IMPORTANCE_PERCEPTIBLE will be returned.

Value: 130

IMPORTANCE_SERVICE

Added in API level 3
static val IMPORTANCE_SERVICE: Int

Constant for importance: This process contains services that should remain running. These are background services apps have started, not something the user is aware of, so they may be killed by the system relatively freely (though it is generally desired that they stay running as long as they want to).

Value: 300

IMPORTANCE_TOP_SLEEPING

Added in API level 23
static val IMPORTANCE_TOP_SLEEPING: Int

Constant for importance: This process is running the foreground UI, but the device is asleep so it is not visible to the user. Though the system will try hard to keep its process from being killed, in all other ways we consider it a kind of cached process, with the limitations that go along with that state: network access, running background services, etc.

Value: 325

IMPORTANCE_TOP_SLEEPING_PRE_28

Added in API level 28
Deprecated in API level 28
static val IMPORTANCE_TOP_SLEEPING_PRE_28: Int

Deprecated: Pre-android.os.Build.VERSION_CODES#P version of IMPORTANCE_TOP_SLEEPING. As of Android android.os.Build.VERSION_CODES#P, this is considered much less important since we want to reduce what apps can do when the screen is off.

Value: 150

IMPORTANCE_VISIBLE

Added in API level 3
static val IMPORTANCE_VISIBLE: Int

Constant for importance: This process is running something that is actively visible to the user, though not in the immediate foreground. This may be running a window that is behind the current foreground (so paused and with its state saved, not interacting with the user, but visible to them to some degree); it may also be running other services under the system's control that it considers important.

Value: 200

REASON_PROVIDER_IN_USE

Added in API level 5
static val REASON_PROVIDER_IN_USE: Int

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.

Value: 1

REASON_SERVICE_IN_USE

Added in API level 5
static val REASON_SERVICE_IN_USE: Int

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.

Value: 2

REASON_UNKNOWN

Added in API level 5
static val REASON_UNKNOWN: Int

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

Value: 0

Public constructors

RunningAppProcessInfo

Added in API level 3
RunningAppProcessInfo()

RunningAppProcessInfo

Added in API level 3
RunningAppProcessInfo(
    pProcessName: String!,
    pPid: Int,
    pArr: Array<String!>!)

Public methods

describeContents

Added in API level 3
open fun describeContents(): Int
Return
Int a bitmask indicating the set of special object types marshaled by this Parcelable object instance. Value is either 0 or android.os.Parcelable#CONTENTS_FILE_DESCRIPTOR

readFromParcel

Added in API level 3
open fun readFromParcel(source: Parcel!): Unit

writeToParcel

Added in API level 3
open fun writeToParcel(
    dest: Parcel,
    flags: Int
): Unit
Parameters
dest Parcel: The Parcel in which the object should be written. This value cannot be null.
flags Int: Additional flags about how the object should be written. May be 0 or PARCELABLE_WRITE_RETURN_VALUE. Value is either 0 or a combination of android.os.Parcelable#PARCELABLE_WRITE_RETURN_VALUE, and android.os.Parcelable.PARCELABLE_ELIDE_DUPLICATES

Properties

importanceReasonCode

Added in API level 5
var importanceReasonCode: Int

The reason for importance, if any.

importanceReasonComponent

Added in API level 5
var importanceReasonComponent: ComponentName!

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

importanceReasonPid

Added in API level 5
var importanceReasonPid: Int

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.

lastTrimLevel

Added in API level 16
var lastTrimLevel: Int

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

lru

Added in API level 3
var lru: Int

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_CACHED category, though others may be maintained in the future.

pid

Added in API level 3
var pid: Int

The pid of this process; 0 if none

pkgList

Added in API level 3
var pkgList: Array<String!>!

All packages that have been loaded into the process.

processName

Added in API level 3
var processName: String!

The name of the process that this object is associated with

uid

Added in API level 5
var uid: Int

The user id of this process.