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

Commit 84c15541 authored by Bryce Lee's avatar Bryce Lee Committed by android-build-merger
Browse files

Merge "Do not call checkReadyForSleep recursively." into pi-dev am: e5eebd5c

am: eab48999

Change-Id: I7af861f0a940629f3f730f169abc02422091bac5
parents e205c8d1 eab48999
Loading
Loading
Loading
Loading
+12 −12
Original line number Original line Diff line number Diff line
@@ -2284,21 +2284,21 @@ class ActivityStack<T extends StackWindowController> extends ConfigurationContai
            // Protect against recursion.
            // Protect against recursion.
            mStackSupervisor.inResumeTopActivity = true;
            mStackSupervisor.inResumeTopActivity = true;
            result = resumeTopActivityInnerLocked(prev, options);
            result = resumeTopActivityInnerLocked(prev, options);
        } finally {
            mStackSupervisor.inResumeTopActivity = false;
        }


            // When resuming the top activity, it may be necessary to pause the top activity (for
            // When resuming the top activity, it may be necessary to pause the top activity (for
            // example, returning to the lock screen. We suppress the normal pause logic in
            // example, returning to the lock screen. We suppress the normal pause logic in
        // {@link #resumeTopActivityUncheckedLocked}, since the top activity is resumed at the end.
            // {@link #resumeTopActivityUncheckedLocked}, since the top activity is resumed at the
        // We call the {@link ActivityStackSupervisor#checkReadyForSleepLocked} again here to ensure
            // end. We call the {@link ActivityStackSupervisor#checkReadyForSleepLocked} again here
        // any necessary pause logic occurs. In the case where the Activity will be shown regardless
            // to ensure any necessary pause logic occurs. In the case where the Activity will be
        // of the lock screen, the call to {@link ActivityStackSupervisor#checkReadyForSleepLocked}
            // shown regardless of the lock screen, the call to
        // is skipped.
            // {@link ActivityStackSupervisor#checkReadyForSleepLocked} is skipped.
            final ActivityRecord next = topRunningActivityLocked(true /* focusableOnly */);
            final ActivityRecord next = topRunningActivityLocked(true /* focusableOnly */);
            if (next == null || !next.canTurnScreenOn()) {
            if (next == null || !next.canTurnScreenOn()) {
                checkReadyForSleep();
                checkReadyForSleep();
            }
            }
        } finally {
            mStackSupervisor.inResumeTopActivity = false;
        }


        return result;
        return result;
    }
    }