Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2ebc504b authored by Zhi An Ng's avatar Zhi An Ng
Browse files

Revert "Only show dialog if top app is killed"

This reverts commit 90024ace.

Commens in ag/3029299 for more details.
After this is reverted, ag/2891284 will need to be reverted (for oc-mr1-dev),
and ag/2961224 for master).

Reason for revert: No mechanism to check if an app is killed because of low memory killer

Change-Id: I4aeef4f3008280a34f0b898ed7a2da37be006a84
Bug:65488249
parent 90024ace
Loading
Loading
Loading
Loading
+5 −7
Original line number Diff line number Diff line
@@ -5459,7 +5459,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));
@@ -5494,8 +5494,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;
        }
@@ -5505,10 +5505,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();
    }