OSDN Git Service

Merge "Start non-running activity that should be visible in resume state."
[android-x86/frameworks-base.git] / services / core / java / com / android / server / am / ActivityStack.java
index 1fee1ae..a397626 100644 (file)
@@ -1270,6 +1270,7 @@ final class ActivityStack {
         // make sure any activities under it are now visible.
         boolean aboveTop = true;
         boolean behindFullscreen = !isStackVisibleLocked();
+        boolean noStackActivityResumed = (isInStackLocked(starting) == null);
 
         for (int taskNdx = mTaskHistory.size() - 1; taskNdx >= 0; --taskNdx) {
             final TaskRecord task = mTaskHistory.get(taskNdx);
@@ -1297,9 +1298,8 @@ final class ActivityStack {
                     }
 
                     if (r.app == null || r.app.thread == null) {
-                        // This activity needs to be visible, but isn't even
-                        // running...  get it started, but don't resume it
-                        // at this point.
+                        // This activity needs to be visible, but isn't even running...
+                        // get it started and resume if no other stack in this stack is resumed.
                         if (DEBUG_VISIBILITY) Slog.v(TAG_VISIBILITY,
                                 "Start and freeze screen for " + r);
                         if (r != starting) {
@@ -1311,7 +1311,9 @@ final class ActivityStack {
                             setVisible(r, true);
                         }
                         if (r != starting) {
-                            mStackSupervisor.startSpecificActivityLocked(r, false, false);
+                            mStackSupervisor.startSpecificActivityLocked(
+                                    r, noStackActivityResumed, false);
+                            noStackActivityResumed = false;
                         }
 
                     } else if (r.visible) {