summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
Diffstat (limited to 'services')
-rw-r--r--services/core/java/com/android/server/am/ActivityStack.java10
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 a86df2d..6574538 100644
--- a/services/core/java/com/android/server/am/ActivityStack.java
+++ b/services/core/java/com/android/server/am/ActivityStack.java
@@ -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);