diff options
| author | 2017-10-17 03:43:04 +0000 | |
|---|---|---|
| committer | 2017-10-17 03:43:04 +0000 | |
| commit | 8cd461a8fcbea4144465a888576f94e3d2686e4d (patch) | |
| tree | e7bcc48bd7b4c0adb81abddbdb4ed7b362ec3de7 | |
| parent | 7282f37ca840aa5dc6e6279b83dc7d06ebb5506c (diff) | |
| parent | fa3cc209e99a1985ff223755de394c4aea067799 (diff) | |
Merge "Revert "Only show dialog if top app is killed"" into oc-mr1-dev am: d6065d16e1
am: fa3cc209e9
Change-Id: I5f00d7989b2849c89710e8f24ec8bc33837913f6
| -rw-r--r-- | services/core/java/com/android/server/am/ActivityManagerService.java | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/services/core/java/com/android/server/am/ActivityManagerService.java b/services/core/java/com/android/server/am/ActivityManagerService.java index 5f377f7aa7a6..51dfa8bcda61 100644 --- a/services/core/java/com/android/server/am/ActivityManagerService.java +++ b/services/core/java/com/android/server/am/ActivityManagerService.java @@ -5424,7 +5424,7 @@ public class ActivityManagerService extends IActivityManager.Stub boolean doLowMem = app.instr == null; boolean doOomAdj = doLowMem; if (!app.killedByAm) { - maybeNotifyTopAppKilledLocked(app); + maybeNotifyTopAppKilled(app); Slog.i(TAG, "Process " + app.processName + " (pid " + pid + ") has died: " + ProcessList.makeOomAdjString(app.setAdj) + ProcessList.makeProcStateString(app.setProcState)); @@ -5459,8 +5459,8 @@ public class ActivityManagerService extends IActivityManager.Stub } /** Show system error dialog when a top app is killed by LMK */ - void maybeNotifyTopAppKilledLocked(ProcessRecord app) { - if (!shouldNotifyTopAppKilledLocked(app)) { + void maybeNotifyTopAppKilled(ProcessRecord app) { + if (!shouldNotifyTopAppKilled(app)) { return; } @@ -5470,10 +5470,8 @@ public class ActivityManagerService extends IActivityManager.Stub } /** Only show notification when the top app is killed on low ram devices */ - private boolean shouldNotifyTopAppKilledLocked(ProcessRecord app) { - final ActivityRecord TOP_ACT = resumedAppLocked(); - final ProcessRecord TOP_APP = TOP_ACT != null ? TOP_ACT.app : null; - return app == TOP_APP && + private boolean shouldNotifyTopAppKilled(ProcessRecord app) { + return app.curSchedGroup == ProcessList.SCHED_GROUP_TOP_APP && ActivityManager.isLowRamDeviceStatic(); } |