Set non-starting visible resumed activity as resumed activity for the stack
When ensuring visible activities for a stack we check to see if there is
already a resumed activity on the stack, so if we need to start an
activity that needs to be visible, we start it in the paused state
if there is already a resumed activity in the stack. This was't
taking into account a non-starting, visible, and resumed activity.
One case this can happen is if the currently resumed activity in
the stack becomes translucent and the activity behind it needs to
be started because it was previously destroyed due to low memory.
Bug: 19636839
Change-Id: I31670fd64d3bcbbf41823f51518ca603c7412e92
diff --git a/services/core/java/com/android/server/am/ActivityStack.java b/services/core/java/com/android/server/am/ActivityStack.java
index 33f915f..62d70d2 100644
--- a/services/core/java/com/android/server/am/ActivityStack.java
+++ b/services/core/java/com/android/server/am/ActivityStack.java
@@ -1331,6 +1331,9 @@
}
} catch(RemoteException e) {
}
+ if (r.state == ActivityState.RESUMED) {
+ noStackActivityResumed = false;
+ }
} else {
// This activity is not currently visible, but is running.
// Tell it to become visible.