From 34a07f43e483767ceae39a1bcdb621ffc3a577a0 Mon Sep 17 00:00:00 2001 From: Winson Chung Date: Fri, 10 Mar 2017 18:06:25 -0800 Subject: [PATCH] Fix regression in rotation rect being clobbered. - We should not be using the tmp rect as it's already being used by the caller in onTaskStackBoundsChanged(). Test: Rotate device while PiP is up. Change-Id: I826f6379666c72be505185cd0c101b18a8277177 --- .../core/java/com/android/server/wm/PinnedStackController.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/services/core/java/com/android/server/wm/PinnedStackController.java b/services/core/java/com/android/server/wm/PinnedStackController.java index 1d50d0d3826fe..0e6b1b6a6ce91 100644 --- a/services/core/java/com/android/server/wm/PinnedStackController.java +++ b/services/core/java/com/android/server/wm/PinnedStackController.java @@ -108,6 +108,7 @@ class PinnedStackController { private final DisplayMetrics mTmpMetrics = new DisplayMetrics(); private final Rect mTmpInsets = new Rect(); private final Rect mTmpRect = new Rect(); + private final Rect mTmpAnimatingBoundsRect = new Rect(); private final Point mTmpDisplaySize = new Point(); /** @@ -359,7 +360,7 @@ class PinnedStackController { if (isValidPictureInPictureAspectRatio(mAspectRatio)) { transformBoundsToAspectRatio(normalBounds, mAspectRatio); } - final Rect animatingBounds = mTmpRect; + final Rect animatingBounds = mTmpAnimatingBoundsRect; final TaskStack pinnedStack = mDisplayContent.getStackById(PINNED_STACK_ID); if (pinnedStack != null) { pinnedStack.getAnimatingBounds(animatingBounds);