diff options
| author | 2015-04-08 09:18:54 -0700 | |
|---|---|---|
| committer | 2015-05-08 13:25:12 -0700 | |
| commit | 5c42e508d1c76d99bb95edd43e1e12a282a05344 (patch) | |
| tree | 1b159dd7f200f8d7007ad0620ae8daf45df3a818 | |
| parent | 3974fb239392099608f969254c4d86e7d13ab32d (diff) | |
Move visibleBehind activities into stop state when sleeping/powerDown
Bug: 19523564
Change-Id: I95273a659edc91c5636d6a0d9cd7fe5683ec4f3e
| -rw-r--r-- | services/core/java/com/android/server/am/ActivityStack.java | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/services/core/java/com/android/server/am/ActivityStack.java b/services/core/java/com/android/server/am/ActivityStack.java index 62d70d2fa799..951b9a94e4e5 100644 --- a/services/core/java/com/android/server/am/ActivityStack.java +++ b/services/core/java/com/android/server/am/ActivityStack.java @@ -747,6 +747,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; } @@ -1006,7 +1014,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); |