public class AndroidAppProcess extends AndroidProcess
Modifier and Type | Class and Description |
---|---|
static class |
AndroidAppProcess.NotAndroidAppProcessException |
Modifier and Type | Field and Description |
---|---|
static android.os.Parcelable.Creator<AndroidAppProcess> |
CREATOR |
boolean |
foreground
true if the process is in the foreground |
int |
uid
The user id of this process.
|
name, pid
Modifier | Constructor and Description |
---|---|
|
AndroidAppProcess(int pid) |
protected |
AndroidAppProcess(android.os.Parcel in) |
Modifier and Type | Method and Description |
---|---|
Cgroup |
cgroup()
/proc/[pid]/cgroup (since Linux 2.6.24)
|
android.content.pm.PackageInfo |
getPackageInfo(android.content.Context context,
int flags)
Retrieve overall information about the application package.
|
java.lang.String |
getPackageName() |
void |
writeToParcel(android.os.Parcel dest,
int flags) |
attr_current, cmdline, describeContents, oom_adj, oom_score_adj, read, stat, statm, status, wchan
public boolean foreground
true
if the process is in the foregroundpublic int uid
public static final android.os.Parcelable.Creator<AndroidAppProcess> CREATOR
public AndroidAppProcess(int pid) throws java.io.IOException, AndroidAppProcess.NotAndroidAppProcessException
java.io.IOException
AndroidAppProcess.NotAndroidAppProcessException
protected AndroidAppProcess(android.os.Parcel in)
public java.lang.String getPackageName()
AndroidProcess.name
public android.content.pm.PackageInfo getPackageInfo(android.content.Context context, int flags) throws android.content.pm.PackageManager.NameNotFoundException
Throws PackageManager.NameNotFoundException
if a package with the given name can
not be found on the system.
context
- the application contextflags
- Additional option flags. Use any combination of
PackageManager.GET_ACTIVITIES
, PackageManager.GET_GIDS
,
PackageManager.GET_CONFIGURATIONS
, PackageManager.GET_INSTRUMENTATION
,
PackageManager.GET_PERMISSIONS
, PackageManager.GET_PROVIDERS
,
PackageManager.GET_RECEIVERS
, PackageManager.GET_SERVICES
,
PackageManager.GET_SIGNATURES
, PackageManager.GET_UNINSTALLED_PACKAGES
to modify the data returned.android.content.pm.PackageManager.NameNotFoundException
public Cgroup cgroup()
AndroidProcess
/proc/[pid]/cgroup (since Linux 2.6.24)
This file describes control groups to which the process/task belongs. For each cgroup hierarchy there is one entry containing colon-separated fields of the form:
5:cpuacct,cpu,cpuset:/daemons
The colon-separated fields are, from left to right:
This file is present only if the CONFIG_CGROUPS kernel configuration option is enabled.
cgroup
in class AndroidProcess
Cgroup
for this processpublic void writeToParcel(android.os.Parcel dest, int flags)
writeToParcel
in interface android.os.Parcelable
writeToParcel
in class AndroidProcess