Set stack size and position and update children surface position.
Update the stack's size and position to represent the bounds. Then
update all children's positions so they are in the correct place within
the stack's bounds.
Test: Split screen, pip
Change-Id: I0372a8d20407ec35d1e8c0fc8165253f68d2f18f
diff --git a/services/core/java/com/android/server/wm/Task.java b/services/core/java/com/android/server/wm/Task.java
index 374c06c..3c96ca1 100644
--- a/services/core/java/com/android/server/wm/Task.java
+++ b/services/core/java/com/android/server/wm/Task.java
@@ -649,6 +649,9 @@
mDimmer.resetDimStates();
super.prepareSurfaces();
getDimBounds(mTmpDimBoundsRect);
+
+ // Bounds need to be relative, as the dim layer is a child.
+ mTmpDimBoundsRect.offsetTo(0, 0);
if (mDimmer.updateDims(getPendingTransaction(), mTmpDimBoundsRect)) {
scheduleAnimation();
}