Update DimLayer sizes on rotation.

Required replumbing and updating the TaskStack bounds calculations
to match the new separation of TaskStack from DisplayContent.

Fixes bug 12780687.

Change-Id: I061c92831c06f4eb3e673ad6296e721b0c0f3202
diff --git a/services/core/java/com/android/server/wm/DisplayContent.java b/services/core/java/com/android/server/wm/DisplayContent.java
index 415a06b..68834d8 100644
--- a/services/core/java/com/android/server/wm/DisplayContent.java
+++ b/services/core/java/com/android/server/wm/DisplayContent.java
@@ -170,22 +170,13 @@
     }
 
     void updateDisplayInfo() {
-        // Save old size.
-        int oldWidth = mDisplayInfo.logicalWidth;
-        int oldHeight = mDisplayInfo.logicalHeight;
         mDisplay.getDisplayInfo(mDisplayInfo);
-
         for (int i = mStacks.size() - 1; i >= 0; --i) {
-            final TaskStack stack = mStacks.get(i);
-            if (!stack.isFullscreen()) {
-                stack.resizeBounds(oldWidth, oldHeight, mDisplayInfo.logicalWidth,
-                        mDisplayInfo.logicalHeight);
-            }
+            mStacks.get(i).updateDisplayInfo();
         }
     }
 
     void getLogicalDisplayRect(Rect out) {
-        updateDisplayInfo();
         // Uses same calculation as in LogicalDisplay#configureDisplayInTransactionLocked.
         final int orientation = mDisplayInfo.rotation;
         boolean rotated = (orientation == Surface.ROTATION_90
@@ -291,11 +282,12 @@
     }
 
     boolean isDimming() {
-        boolean result = false;
         for (int stackNdx = mStacks.size() - 1; stackNdx >= 0; --stackNdx) {
-            result |= mStacks.get(stackNdx).isDimming();
+            if (mStacks.get(stackNdx).isDimming()) {
+                return true;
+            }
         }
-        return result;
+        return false;
     }
 
     void stopDimmingIfNeeded() {