From 5952f9aea4d0f5242d9678eb491ea7aa54734e66 Mon Sep 17 00:00:00 2001 From: Wale Ogunwale Date: Mon, 25 Apr 2016 13:40:30 -0700 Subject: [PATCH] Fixed issue with wrong stack fullscreen state on configuration change - No need to run TaskStack#updateBoundsAfterConfigChange if the stack is fullscreen as the bounds will already be updated to when the display content changed due to rotation. - Correctly set mTmpRect2 that we are using to calculate the rotated bounds to the current mBounds. Bug: 28319277 Bug: 27870534 Change-Id: Ic3d9407b735210351c28297de79bf035909afcfe --- services/core/java/com/android/server/wm/TaskStack.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/services/core/java/com/android/server/wm/TaskStack.java b/services/core/java/com/android/server/wm/TaskStack.java index 037f31679b6a5..6f8207e23c5b7 100644 --- a/services/core/java/com/android/server/wm/TaskStack.java +++ b/services/core/java/com/android/server/wm/TaskStack.java @@ -383,6 +383,12 @@ public class TaskStack implements DimLayer.DimLayerUser, } boolean updateBoundsAfterConfigChange(boolean scheduleResize) { + if (mFullscreen) { + // Bounds will already be set correctly when display info is updated in the case of + // fullscreen. + return false; + } + if (mLastConfigChangedRotation != mLastUpdateDisplayInfoRotation) { // We wait for the rotation values after configuration change and display info. update // to be equal before updating the bounds due to rotation change otherwise things might @@ -399,6 +405,7 @@ public class TaskStack implements DimLayer.DimLayerUser, } final int oldDockSide = mStackId == DOCKED_STACK_ID ? getDockSide() : DOCKED_INVALID; + mTmpRect2.set(mBounds); mDisplayContent.rotateBounds(mRotation, newRotation, mTmpRect2); if (mStackId == DOCKED_STACK_ID) { repositionDockedStackAfterRotation(mTmpRect2);