OSDN Git Service

Don't specify stack bounds for unsizeable home stack in dock mode
authorWale Ogunwale <ogunwale@google.com>
Mon, 24 Apr 2017 17:15:31 +0000 (10:15 -0700)
committerWale Ogunwale <ogunwale@google.com>
Mon, 24 Apr 2017 17:15:31 +0000 (10:15 -0700)
Doing so will put the stack in multi-window mode which means it
can't affect the device orientation which can cause the app to
to put in a configuration it doesn't support when in split-screen
multi-window mode.

Test: manual
Change-Id: I9f08187d8880c8f2b486f477123342a9a2f7effc
Fixes: 37334914

services/core/java/com/android/server/wm/TaskStack.java

index 1feb743..da7a9f0 100644 (file)
@@ -733,10 +733,17 @@ public class TaskStack extends WindowContainer<Task> implements DimLayer.DimLaye
         outTempTaskBounds.setEmpty();
 
         // When the home stack is resizable, should always have the same stack and task bounds
-        if (mStackId == HOME_STACK_ID && findHomeTask().isResizeable()) {
-            // Calculate the home stack bounds when in docked mode
-            getDisplayContent().mDividerControllerLocked
-                    .getHomeStackBoundsInDockedMode(outStackBounds);
+        if (mStackId == HOME_STACK_ID) {
+            if (findHomeTask().isResizeable()) {
+                // Calculate the home stack bounds when in docked mode and the home stack is
+                // resizeable.
+                getDisplayContent().mDividerControllerLocked
+                        .getHomeStackBoundsInDockedMode(outStackBounds);
+            } else {
+                // Home stack isn't resizeable, so don't specify stack bounds.
+                outStackBounds.setEmpty();
+            }
+
             outTempTaskBounds.set(outStackBounds);
             return;
         }