public class RunningProcessInfo extends Object
SystemCapability.Aafwk#ABILITY| 限定符和类型 | 字段 | 说明 |
|---|---|---|
static int |
DATA_IN_USE |
Indicates that one of the application's abilities using the Data template is being called by another process.
|
static int |
REASON_UNKNOWN |
Indicates that there is no special reason for this weight level.
|
static int |
SERVICE_IN_USE |
Indicates that one of the application's Service abilities is being called by another process.
|
static int |
WEIGHT_CACHED |
Indicates that this process contains cached data that can be cleared and does not proactively run any
application components.
|
static int |
WEIGHT_CANT_SAVE_STATE |
Indicates that the application running in this process cannot save the process state and this process cannot
be killed when it is running in the background.
|
static int |
WEIGHT_FOREGROUND |
Indicates that this process is running the foreground UI.
|
static int |
WEIGHT_FOREGROUND_SERVICE |
Indicates that this process is running an ability using the Service template (Service ability for short)
perceptible to the user, for example, music playback in the background.
|
static int |
WEIGHT_GONE |
Indicates that this process does not exist.
|
static int |
WEIGHT_PERCEPTIBLE |
Indicates that this process is not directly perceptible to the user.
|
static int |
WEIGHT_SERVICE |
Indicates that this process contains Service abilities that keep running in the background.
|
static int |
WEIGHT_TOP_SLEEPING |
Indicates that this process is running the foreground UI when the device is sleeping.
|
static int |
WEIGHT_VISIBLE |
Indicates that this process is running something that is active but not on the foreground UI, for example,
an application running in the background.
|
| 构造器 | 说明 |
|---|---|
RunningProcessInfo() |
A constructor used to create a
RunningProcessInfo instance. |
| 限定符和类型 | 方法 | 说明 |
|---|---|---|
int |
getLastMemoryLevel() |
Obtains the last memory trimming level reported to the process, which corresponds to the value passed to
Ability#onMemoryLevel(int). |
int |
getPid() |
Obtains the ID of the current process.
|
String[] |
getPkgList() |
Obtains a list of bundles loaded by the current process.
|
String |
getProcessName() |
Obtains the name of the process where the application is running.
|
int |
getUid() |
Obtains the ID of the user who installed the application.
|
int |
getWeight() |
Obtains the weight level of this process.
|
int |
getWeightReasonCode() |
Obtains the reason for the weight level of this process.
|
String |
toString() |
Returns a string representation of the object.
|
public static final int DATA_IN_USE
public static final int REASON_UNKNOWN
public static final int SERVICE_IN_USE
public static final int WEIGHT_CACHED
public static final int WEIGHT_CANT_SAVE_STATE
public static final int WEIGHT_FOREGROUND
public static final int WEIGHT_FOREGROUND_SERVICE
public static final int WEIGHT_GONE
public static final int WEIGHT_PERCEPTIBLE
public static final int WEIGHT_SERVICE
public static final int WEIGHT_TOP_SLEEPING
public static final int WEIGHT_VISIBLE
public RunningProcessInfo()
RunningProcessInfo instance.public int getPid()
public String[] getPkgList()
public String getProcessName()
public int getUid()
public int getLastMemoryLevel()
Ability#onMemoryLevel(int).public int getWeight()
WEIGHT_FOREGROUND or WEIGHT_SERVICE.public int getWeightReasonCode()
REASON_UNKNOWN,
DATA_IN_USE, or SERVICE_IN_USE.public String toString()
ObjecttoString method returns a string that
"textually represents" this object. The result should
be a concise but informative representation that is easy for a
person to read.
It is recommended that all subclasses override this method.
The toString method for class Object
returns a string consisting of the name of the class of which the
object is an instance, the at-sign character `@', and
the unsigned hexadecimal representation of the hash code of the
object. In other words, this method returns a string equal to the
value of:
getClass().getName() + '@' + Integer.toHexString(hashCode())