From f9b64545248990a63b349859c2024d7f2cdd16bc Mon Sep 17 00:00:00 2001 From: Zhi An Ng Date: Mon, 16 Oct 2017 23:03:22 +0000 Subject: [PATCH] DO NOT MERGE Revert "Show dialog if top app is killed by lmk" This reverts commit 84a2e2a06bb95e9c30f10a77d0fb90386b0f470d. Comments in ag/3029299 for more details. This revert is dependent on another revert ag/3074066, which has been merged. Reason for revert: No mechanism to check if an app is killed because of low memory killer Bug:65488249 Test: manual Change-Id: I2940a5b9f22f3428432537acbf64a10f81b0b9d0 --- core/res/res/values/strings.xml | 7 ----- core/res/res/values/symbols.xml | 3 -- .../server/am/ActivityManagerService.java | 30 ------------------- 3 files changed, 40 deletions(-) diff --git a/core/res/res/values/strings.xml b/core/res/res/values/strings.xml index 5347719ef9932..ce6815f10b30c 100644 --- a/core/res/res/values/strings.xml +++ b/core/res/res/values/strings.xml @@ -2679,8 +2679,6 @@ OK Cancel - - CLOSE @@ -2813,11 +2811,6 @@ Re-enable this in System settings > Apps > Downloaded. - - App isn\'t responding - - %1$s may be using too much memory. - %1$s does not support the current Display size setting and may behave unexpectedly. diff --git a/core/res/res/values/symbols.xml b/core/res/res/values/symbols.xml index b36630e07f683..0548db69a05da 100644 --- a/core/res/res/values/symbols.xml +++ b/core/res/res/values/symbols.xml @@ -1890,9 +1890,6 @@ - - - diff --git a/services/core/java/com/android/server/am/ActivityManagerService.java b/services/core/java/com/android/server/am/ActivityManagerService.java index b4741d12bc150..1520b96a4afd4 100644 --- a/services/core/java/com/android/server/am/ActivityManagerService.java +++ b/services/core/java/com/android/server/am/ActivityManagerService.java @@ -1690,7 +1690,6 @@ public class ActivityManagerService extends IActivityManager.Stub static final int SERVICE_FOREGROUND_CRASH_MSG = 69; static final int DISPATCH_OOM_ADJ_OBSERVER_MSG = 70; static final int START_USER_SWITCH_FG_MSG = 712; - static final int TOP_APP_KILLED_BY_LMK_MSG = 73; static final int NOTIFY_VR_KEYGUARD_MSG = 74; static final int FIRST_ACTIVITY_STACK_MSG = 100; @@ -1923,17 +1922,6 @@ public class ActivityManagerService extends IActivityManager.Stub dispatchProcessDied(pid, uid); break; } - case TOP_APP_KILLED_BY_LMK_MSG: { - final String appName = (String) msg.obj; - final AlertDialog d = new BaseErrorDialog(mUiContext); - d.getWindow().setType(WindowManager.LayoutParams.TYPE_SYSTEM_ERROR); - d.setTitle(mUiContext.getText(R.string.top_app_killed_title)); - d.setMessage(mUiContext.getString(R.string.top_app_killed_message, appName)); - d.setButton(DialogInterface.BUTTON_POSITIVE, mUiContext.getText(R.string.close), - obtainMessage(DISMISS_DIALOG_UI_MSG, d)); - d.show(); - break; - } case DISPATCH_UIDS_CHANGED_UI_MSG: { dispatchUidsChanged(); } break; @@ -5459,7 +5447,6 @@ public class ActivityManagerService extends IActivityManager.Stub boolean doLowMem = app.instr == null; boolean doOomAdj = doLowMem; if (!app.killedByAm) { - maybeNotifyTopAppKilled(app); Slog.i(TAG, "Process " + app.processName + " (pid " + pid + ") has died: " + ProcessList.makeOomAdjString(app.setAdj) + ProcessList.makeProcStateString(app.setProcState)); @@ -5493,23 +5480,6 @@ public class ActivityManagerService extends IActivityManager.Stub } } - /** Show system error dialog when a top app is killed by LMK */ - void maybeNotifyTopAppKilled(ProcessRecord app) { - if (!shouldNotifyTopAppKilled(app)) { - return; - } - - Message msg = mHandler.obtainMessage(TOP_APP_KILLED_BY_LMK_MSG); - msg.obj = mContext.getPackageManager().getApplicationLabel(app.info); - mUiHandler.sendMessage(msg); - } - - /** Only show notification when the top app is killed on low ram devices */ - private boolean shouldNotifyTopAppKilled(ProcessRecord app) { - return app.curSchedGroup == ProcessList.SCHED_GROUP_TOP_APP && - ActivityManager.isLowRamDeviceStatic(); - } - /** * If a stack trace dump file is configured, dump process stack traces. * @param clearTraces causes the dump file to be erased prior to the new