am e57c3a88: Merge "Add APIs for finding heavy-weight apps." into gingerbread
Merge commit 'e57c3a88b99856d1e69fdf115e7c7954594b7385' into gingerbread-plus-aosp * commit 'e57c3a88b99856d1e69fdf115e7c7954594b7385': Add APIs for finding heavy-weight apps.
This commit is contained in:
@@ -21750,6 +21750,17 @@
|
||||
visibility="public"
|
||||
>
|
||||
</field>
|
||||
<field name="FLAG_HEAVY_WEIGHT"
|
||||
type="int"
|
||||
transient="false"
|
||||
volatile="false"
|
||||
value="1"
|
||||
static="true"
|
||||
final="true"
|
||||
deprecated="not deprecated"
|
||||
visibility="public"
|
||||
>
|
||||
</field>
|
||||
<field name="IMPORTANCE_BACKGROUND"
|
||||
type="int"
|
||||
transient="false"
|
||||
@@ -21860,6 +21871,16 @@
|
||||
visibility="public"
|
||||
>
|
||||
</field>
|
||||
<field name="flags"
|
||||
type="int"
|
||||
transient="false"
|
||||
volatile="false"
|
||||
static="false"
|
||||
final="false"
|
||||
deprecated="not deprecated"
|
||||
visibility="public"
|
||||
>
|
||||
</field>
|
||||
<field name="importance"
|
||||
type="int"
|
||||
transient="false"
|
||||
|
||||
@@ -717,8 +717,23 @@ public class ActivityManager {
|
||||
*/
|
||||
public int uid;
|
||||
|
||||
/**
|
||||
* All packages that have been loaded into the process.
|
||||
*/
|
||||
public String pkgList[];
|
||||
|
||||
/**
|
||||
* Constant for {@link #flags}: this is a heavy-weight process,
|
||||
* meaning it will not be killed while in the background.
|
||||
*/
|
||||
public static final int FLAG_HEAVY_WEIGHT = 1<<0;
|
||||
|
||||
/**
|
||||
* Flags of information. May be any of
|
||||
* {@link #FLAG_HEAVY_WEIGHT}.
|
||||
*/
|
||||
public int flags;
|
||||
|
||||
/**
|
||||
* Constant for {@link #importance}: this process is running the
|
||||
* foreground UI.
|
||||
@@ -846,6 +861,7 @@ public class ActivityManager {
|
||||
dest.writeInt(pid);
|
||||
dest.writeInt(uid);
|
||||
dest.writeStringArray(pkgList);
|
||||
dest.writeInt(this.flags);
|
||||
dest.writeInt(importance);
|
||||
dest.writeInt(lru);
|
||||
dest.writeInt(importanceReasonCode);
|
||||
@@ -858,6 +874,7 @@ public class ActivityManager {
|
||||
pid = source.readInt();
|
||||
uid = source.readInt();
|
||||
pkgList = source.readStringArray();
|
||||
flags = source.readInt();
|
||||
importance = source.readInt();
|
||||
lru = source.readInt();
|
||||
importanceReasonCode = source.readInt();
|
||||
|
||||
@@ -9814,6 +9814,9 @@ public final class ActivityManagerService extends ActivityManagerNative implemen
|
||||
new ActivityManager.RunningAppProcessInfo(app.processName,
|
||||
app.pid, app.getPackageList());
|
||||
currApp.uid = app.info.uid;
|
||||
if (mHeavyWeightProcess == app) {
|
||||
currApp.flags |= ActivityManager.RunningAppProcessInfo.FLAG_HEAVY_WEIGHT;
|
||||
}
|
||||
int adj = app.curAdj;
|
||||
if (adj >= EMPTY_APP_ADJ) {
|
||||
currApp.importance = ActivityManager.RunningAppProcessInfo.IMPORTANCE_EMPTY;
|
||||
|
||||
Reference in New Issue
Block a user