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

Commit fd59f746 authored by Wale Ogunwale's avatar Wale Ogunwale Committed by Android Git Automerger
Browse files

am 71617afc: am eadffbc6: am 2a857f00: Merge "Move visibleBehind activities...

am 71617afc: am eadffbc6: am 2a857f00: Merge "Move visibleBehind activities into stop state when sleeping/powerDown" into mnc-dev

* commit '71617afc':
  Move visibleBehind activities into stop state when sleeping/powerDown
parents 471e73e2 71617afc
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -748,6 +748,14 @@ final class ActivityStack {
            return true;
        }

        if (hasVisibleBehindActivity()) {
            // Stop visible behind activity before going to sleep.
            final ActivityRecord r = mActivityContainer.mActivityDisplay.mVisibleBehindActivity;
            mStackSupervisor.mStoppingActivities.add(r);
            if (DEBUG_STATES) Slog.v(TAG, "Sleep still waiting to stop visible behind " + r);
            return true;
        }

        return false;
    }

@@ -1007,7 +1015,7 @@ final class ActivityStack {
                    // the current instance before starting the new one.
                    if (DEBUG_PAUSE) Slog.v(TAG_PAUSE, "Destroying after pause: " + prev);
                    destroyActivityLocked(prev, true, "pause-config");
                } else if (!hasVisibleBehindActivity()) {
                } else if (!hasVisibleBehindActivity() || mService.isSleepingOrShuttingDown()) {
                    // If we were visible then resumeTopActivities will release resources before
                    // stopping.
                    mStackSupervisor.mStoppingActivities.add(prev);