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

Commit f7fbfc73 authored by Wale Ogunwale's avatar Wale Ogunwale Committed by android-build-merger
Browse files

Merge "Don\'t stop paused activities that are visible." into nyc-dev

am: de41f15a

* commit 'de41f15a':
  Don't stop paused activities that are visible.
parents 6f3fe9a5 de41f15a
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -1127,7 +1127,8 @@ final class ActivityStack {
                if (DEBUG_PAUSE) Slog.v(TAG_PAUSE, "Executing finish of activity: " + prev);
                prev = finishCurrentActivityLocked(prev, FINISH_AFTER_VISIBLE, false);
            } else if (prev.app != null) {
                if (DEBUG_PAUSE) Slog.v(TAG_PAUSE, "Enqueueing pending stop: " + prev);
                if (DEBUG_PAUSE) Slog.v(TAG_PAUSE, "Enqueue pending stop if needed: " + prev
                        + " wasStopping=" + wasStopping + " visible=" + prev.visible);
                if (mStackSupervisor.mWaitingVisibleActivities.remove(prev)) {
                    if (DEBUG_SWITCH || DEBUG_PAUSE) Slog.v(TAG_PAUSE,
                            "Complete pause, no longer waiting: " + prev);
@@ -1142,7 +1143,8 @@ final class ActivityStack {
                    // We can't clobber it, because the stop confirmation will not be handled.
                    // We don't need to schedule another stop, we only need to let it happen.
                    prev.state = ActivityState.STOPPING;
                } else if (!hasVisibleBehindActivity() || mService.isSleepingOrShuttingDown()) {
                } else if ((!prev.visible && !hasVisibleBehindActivity())
                        || mService.isSleepingOrShuttingDown()) {
                    // If we were visible then resumeTopActivities will release resources before
                    // stopping.
                    addToStopping(prev);