diff options
| author | 2015-12-07 01:11:01 +0000 | |
|---|---|---|
| committer | 2015-12-07 01:11:01 +0000 | |
| commit | a99fce54d0db51d6141e810d7c9afc058091ea6d (patch) | |
| tree | ee99d693f67c2b19a866b5a922f81538caa8187d | |
| parent | 8d19ad443face8b862ac0a3cac095070a5ac9ad0 (diff) | |
| parent | dba623ae5648923e06157d53fcc0ab8a09a79870 (diff) | |
Merge "Don't lose stopping state when getting paused confirmation."
| -rw-r--r-- | services/core/java/com/android/server/am/ActivityStack.java | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/services/core/java/com/android/server/am/ActivityStack.java b/services/core/java/com/android/server/am/ActivityStack.java index 1f06b454a5a6..04aa90bbe220 100644 --- a/services/core/java/com/android/server/am/ActivityStack.java +++ b/services/core/java/com/android/server/am/ActivityStack.java @@ -1070,6 +1070,7 @@ final class ActivityStack { if (DEBUG_PAUSE) Slog.v(TAG_PAUSE, "Complete pause: " + prev); if (prev != null) { + final boolean wasStopping = prev.state == ActivityState.STOPPING; prev.state = ActivityState.PAUSED; if (prev.finishing) { if (DEBUG_PAUSE) Slog.v(TAG_PAUSE, "Executing finish of activity: " + prev); @@ -1088,9 +1089,15 @@ 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 (wasStopping) { + // We are also stopping, the stop request must have gone soon after the pause. + // 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()) { // If we were visible then resumeTopActivities will release resources before // stopping. + mStackSupervisor.mStoppingActivities.add(prev); if (mStackSupervisor.mStoppingActivities.size() > 3 || prev.frontOfTask && mTaskHistory.size() <= 1) { |