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

Commit d6d50464 authored by Dianne Hackborn's avatar Dianne Hackborn Committed by android-build-merger
Browse files

Merge "Fix issue #25727069: Top sleeping activity overrides foreground service"

am: 683168c1

* commit '683168c1':
  Fix issue #25727069: Top sleeping activity overrides foreground service

Change-Id: Ia558c036bc87686d46ccf0528dc9cd8d44085af5
parents 60b2f808 683168c1
Loading
Loading
Loading
Loading
+8 −7
Original line number Diff line number Diff line
@@ -17720,7 +17720,7 @@ public final class ActivityManagerService extends ActivityManagerNative
        app.systemNoUi = false;
        final int PROCESS_STATE_TOP = mTopProcessState;
        final int PROCESS_STATE_CUR_TOP = mTopProcessState;
        // Determine the importance of the process, starting with most
        // important to least, and assign an appropriate OOM adjustment.
@@ -17735,7 +17735,7 @@ public final class ActivityManagerService extends ActivityManagerNative
            schedGroup = Process.THREAD_GROUP_DEFAULT;
            app.adjType = "top-activity";
            foregroundActivities = true;
            procState = PROCESS_STATE_TOP;
            procState = PROCESS_STATE_CUR_TOP;
        } else if (app.instrumentationClass != null) {
            // Don't want to kill running instrumentation.
            adj = ProcessList.FOREGROUND_APP_ADJ;
@@ -17788,8 +17788,8 @@ public final class ActivityManagerService extends ActivityManagerNative
                        adj = ProcessList.VISIBLE_APP_ADJ;
                        app.adjType = "visible";
                    }
                    if (procState > PROCESS_STATE_TOP) {
                        procState = PROCESS_STATE_TOP;
                    if (procState > PROCESS_STATE_CUR_TOP) {
                        procState = PROCESS_STATE_CUR_TOP;
                    }
                    schedGroup = Process.THREAD_GROUP_DEFAULT;
                    app.cached = false;
@@ -17801,8 +17801,8 @@ public final class ActivityManagerService extends ActivityManagerNative
                        adj = ProcessList.PERCEPTIBLE_APP_ADJ;
                        app.adjType = "pausing";
                    }
                    if (procState > PROCESS_STATE_TOP) {
                        procState = PROCESS_STATE_TOP;
                    if (procState > PROCESS_STATE_CUR_TOP) {
                        procState = PROCESS_STATE_CUR_TOP;
                    }
                    schedGroup = Process.THREAD_GROUP_DEFAULT;
                    app.cached = false;
@@ -17837,7 +17837,8 @@ public final class ActivityManagerService extends ActivityManagerNative
            }
        }
        if (adj > ProcessList.PERCEPTIBLE_APP_ADJ) {
        if (adj > ProcessList.PERCEPTIBLE_APP_ADJ
                || procState > ActivityManager.PROCESS_STATE_FOREGROUND_SERVICE) {
            if (app.foregroundServices) {
                // The user is aware of this app, so make it visible.
                adj = ProcessList.PERCEPTIBLE_APP_ADJ;