OSDN Git Service

Prevent minimized state changing from other transitions.
authorWinson Chung <winsonc@google.com>
Mon, 13 Mar 2017 23:14:45 +0000 (16:14 -0700)
committerWinson Chung <winsonc@google.com>
Wed, 15 Mar 2017 17:03:15 +0000 (10:03 -0700)
- When calling adjustFocusedActivityStackLocked(), prevent the home stack
  from being brought forward if the task is not over the home stack.  This
  was causing issues with the docked stack triggering minimized mode when
  a task was removed in the assistant stack.
- When checking the visibility of the docked stack, only base it on the
  visibility of the assistant stack when it is above the docked stack.
  This was causing issues with the docked stack reporting as visible even
  when behind the assistant stack due to the subsequent code being run.

Bug: 35363819
Test: android.server.cts.ActivityManagerAssistantStackTests
Change-Id: I48cc901cb6b6166697a4130cc4639ee8f9581f02

services/core/java/com/android/server/am/ActivityStack.java

index 2d91cad..b1bd175 100644 (file)
@@ -1573,9 +1573,9 @@ class ActivityStack<T extends StackWindowController> extends ConfigurationContai
 
             // If the assistant stack is focused and translucent, then the docked stack is always
             // visible
-            if (topStack.isAssistantStack()
-                    && topStack.isStackTranslucent(starting, DOCKED_STACK_ID)) {
-                return STACK_VISIBLE;
+            if (topStack.isAssistantStack()) {
+                return (topStack.isStackTranslucent(starting, DOCKED_STACK_ID)) ? STACK_VISIBLE
+                        : STACK_INVISIBLE;
             }
 
             // Otherwise, the docked stack is always visible, except in the case where the top
@@ -3205,7 +3205,8 @@ class ActivityStack<T extends StackWindowController> extends ConfigurationContai
                     }
                     // Move the home stack to the top if this stack is fullscreen or there is no
                     // other visible stack.
-                    if (mStackSupervisor.moveHomeStackTaskToTop(myReason)) {
+                    if (task.isOverHomeStack() &&
+                            mStackSupervisor.moveHomeStackTaskToTop(myReason)) {
                         // Activity focus was already adjusted. Nothing else to do...
                         return;
                     }