Introducing WindowConfiguration

Used to house configurations that don't affect resources and that
we don't want to communicate to apps, but need to be propagated
along side Configuration.

Test: bit FrameworksServicesTests:com.android.server.wm.WindowConfigurationTests
Test: adb shell am instrument -w -e package com.android.server.wm com.android.frameworks.servicestests/android.support.test.runner.AndroidJUnitRunner
Change-Id: I97de3efbe6d5e1d3b07156a8cfbce9be5eae5cb5
diff --git a/services/core/java/com/android/server/wm/DisplayContent.java b/services/core/java/com/android/server/wm/DisplayContent.java
index 2df773e..2e7f822 100644
--- a/services/core/java/com/android/server/wm/DisplayContent.java
+++ b/services/core/java/com/android/server/wm/DisplayContent.java
@@ -1205,8 +1205,9 @@
         final int leftInset = mTmpRect.left;
         final int topInset = mTmpRect.top;
         // appBounds at the root level should mirror the app screen size.
-        config.setAppBounds(leftInset /*left*/, topInset /*top*/, leftInset + displayInfo.appWidth /*right*/,
-                topInset + displayInfo.appHeight /*bottom*/);
+        config.windowConfiguration.setAppBounds(leftInset /* left */, topInset /* top */,
+                leftInset + displayInfo.appWidth /* right */,
+                topInset + displayInfo.appHeight /* bottom */);
         final boolean rotated = (displayInfo.rotation == Surface.ROTATION_90
                 || displayInfo.rotation == Surface.ROTATION_270);
 
diff --git a/services/core/java/com/android/server/wm/DockedStackDividerController.java b/services/core/java/com/android/server/wm/DockedStackDividerController.java
index 2b45d67..ce21991 100644
--- a/services/core/java/com/android/server/wm/DockedStackDividerController.java
+++ b/services/core/java/com/android/server/wm/DockedStackDividerController.java
@@ -241,8 +241,8 @@
             final int leftInset = mTmpRect.left;
             final int topInset = mTmpRect.top;
 
-            config.setAppBounds(leftInset /*left*/, topInset /*top*/, leftInset + appWidth /*right*/,
-                    topInset + appHeight /*bottom*/);
+            config.windowConfiguration.setAppBounds(leftInset /*left*/, topInset /*top*/,
+                    leftInset + appWidth /*right*/, topInset + appHeight /*bottom*/);
 
             config.screenWidthDp = (int)
                     (mService.mPolicy.getConfigDisplayWidth(dw, dh, rotation, baseConfig.uiMode,
diff --git a/services/core/java/com/android/server/wm/StackWindowController.java b/services/core/java/com/android/server/wm/StackWindowController.java
index 9c44c14..358b8be 100644
--- a/services/core/java/com/android/server/wm/StackWindowController.java
+++ b/services/core/java/com/android/server/wm/StackWindowController.java
@@ -16,11 +16,9 @@
 
 package com.android.server.wm;
 
-import static android.app.ActivityManager.StackId.DOCKED_STACK_ID;
 import static android.app.ActivityManager.StackId.PINNED_STACK_ID;
 
 import android.app.ActivityManager.StackId;
-import android.app.RemoteAction;
 import android.content.res.Configuration;
 import android.graphics.Rect;
 import android.os.Handler;
@@ -30,11 +28,9 @@
 import android.util.SparseArray;
 import android.view.DisplayInfo;
 
-import com.android.server.UiThread;
 import com.android.internal.annotations.VisibleForTesting;
 
 import java.lang.ref.WeakReference;
-import java.util.List;
 
 import static com.android.server.wm.WindowContainer.POSITION_BOTTOM;
 import static com.android.server.wm.WindowContainer.POSITION_TOP;
@@ -278,9 +274,9 @@
             int width;
             int height;
 
-            final Rect parentAppBounds = parentConfig.appBounds;
+            final Rect parentAppBounds = parentConfig.windowConfiguration.getAppBounds();
 
-            config.setAppBounds(!bounds.isEmpty() ? bounds : null);
+            config.windowConfiguration.setAppBounds(!bounds.isEmpty() ? bounds : null);
             boolean intersectParentBounds = false;
 
             if (StackId.tasksAreFloating(mStackId)) {
@@ -295,7 +291,7 @@
                     nonDecorBounds.inset(mTmpNonDecorInsets);
                     // Move app bounds to zero to apply intersection with parent correctly. They are
                     // used only for evaluating width and height, so it's OK to move them around.
-                    config.appBounds.offsetTo(0, 0);
+                    config.windowConfiguration.getAppBounds().offsetTo(0, 0);
                     intersectParentBounds = true;
                 }
                 width = (int) (stableBounds.width() / density);
@@ -319,8 +315,8 @@
                 intersectParentBounds = true;
             }
 
-            if (intersectParentBounds && config.appBounds != null) {
-                config.appBounds.intersect(parentAppBounds);
+            if (intersectParentBounds && config.windowConfiguration.getAppBounds() != null) {
+                config.windowConfiguration.getAppBounds().intersect(parentAppBounds);
             }
 
             config.screenWidthDp = width;