Window resize reporting improvement when docked stack is created

There were a few issues with window resize reporting when a docked
stack is created that caused the client to get frames for fulscreen
even though the task was in split-screen mode.

- Ignore docked stack visibility when get bounds for other stack when
resizing due to docked stack.
- Immediately resize all other stacks in activity manager when the
docked stack is attached to the display.
- Defer surface layouts for the uncheck portion of moving a task to a
stack.
- Don't perform layout of all windows on a display when a stack is
attached to the display since it doesn't have any windows yet.

Bug: 26861802
Change-Id: I2c7f31153da48618e90607c98ec5b29492b6ef38
diff --git a/services/core/java/com/android/server/am/ActivityStack.java b/services/core/java/com/android/server/am/ActivityStack.java
index 4825d57..5a0c1c1 100644
--- a/services/core/java/com/android/server/am/ActivityStack.java
+++ b/services/core/java/com/android/server/am/ActivityStack.java
@@ -395,6 +395,13 @@
             mTaskPositioner.setDisplay(activityDisplay.mDisplay);
             mTaskPositioner.configure(mBounds);
         }
+
+        if (mStackId == DOCKED_STACK_ID) {
+            // If we created a docked stack we want to resize it so it resizes all other stacks
+            // in the system.
+            mStackSupervisor.resizeDockedStackLocked(
+                    mBounds, null, null, null, null, PRESERVE_WINDOWS);
+        }
     }
 
     void detachDisplay() {