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

Commit 03625369 authored by Bryce Lee's avatar Bryce Lee
Browse files

Update reference to top activity.

A condition dealing with a paused top activity references the last
paused activity rather than the top activity. While technically
correct, this may be confusing. Updating to solely reference the
top activity.

Fixes: 65585235
Test: cts/hostsidetests/services/activityandwindowmanager/util/run-test CtsServicesHostTestCases android.server.cts.ActivityManagerDisplayTests#testExternalDisplayActivityTurnPrimaryOff
Change-Id: Ie67cb8b103e7dec59b1c0b40a5bb35ef0c3cb2b7
parent 6f76cee0
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -1199,6 +1199,7 @@ class ActivityStack<T extends StackWindowController> extends ConfigurationContai
     * process of going to sleep (checkReadyForSleep will be called when that process finishes).
     */
    boolean goToSleepIfPossible(boolean shuttingDown) {
        final ActivityRecord topActivity = topActivity();
        boolean shouldSleep = true;

        if (mResumedActivity != null) {
@@ -1223,10 +1224,10 @@ class ActivityStack<T extends StackWindowController> extends ConfigurationContai
            // Still waiting for something to pause; can't sleep yet.
            if (DEBUG_PAUSE) Slog.v(TAG_PAUSE, "Sleep still waiting to pause " + mPausingActivity);
            shouldSleep = false;
        } else if (topActivity() != null && topActivity().state == ActivityState.PAUSED) {
        } else if (topActivity != null && topActivity.state == ActivityState.PAUSED) {
            // Our top activity is currently paused, we need to ensure we move it to the stopped
            // state.
            stopActivityLocked(mLastPausedActivity);
            stopActivityLocked(topActivity);
            shouldSleep = false;
        }