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

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

Do not stop paused activity when sleeping.

This changelist removes logic added to stop a top level paused
activity when trying to sleep. Doing so delays sleep and leads to
double sleep requests on the client side as it will also try to
stop the activity on sleep.

Bug: 65457314
Test: manual
Change-Id: I252e2b968a537cf2d696972d6a65e43661875943
parent 33b1e1fe
Loading
Loading
Loading
Loading
+0 −6
Original line number Original line Diff line number Diff line
@@ -1190,7 +1190,6 @@ class ActivityStack<T extends StackWindowController> extends ConfigurationContai
     * process of going to sleep (checkReadyForSleep will be called when that process finishes).
     * process of going to sleep (checkReadyForSleep will be called when that process finishes).
     */
     */
    boolean goToSleepIfPossible(boolean shuttingDown) {
    boolean goToSleepIfPossible(boolean shuttingDown) {
        final ActivityRecord topActivity = topActivity();
        boolean shouldSleep = true;
        boolean shouldSleep = true;


        if (mResumedActivity != null) {
        if (mResumedActivity != null) {
@@ -1215,11 +1214,6 @@ class ActivityStack<T extends StackWindowController> extends ConfigurationContai
            // Still waiting for something to pause; can't sleep yet.
            // Still waiting for something to pause; can't sleep yet.
            if (DEBUG_PAUSE) Slog.v(TAG_PAUSE, "Sleep still waiting to pause " + mPausingActivity);
            if (DEBUG_PAUSE) Slog.v(TAG_PAUSE, "Sleep still waiting to pause " + mPausingActivity);
            shouldSleep = false;
            shouldSleep = false;
        } 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(topActivity);
            shouldSleep = false;
        }
        }


        if (!shuttingDown) {
        if (!shuttingDown) {