From ccc335cfc799163424d6c3cc457213cbcb4d49ee Mon Sep 17 00:00:00 2001 From: Chong Zhang Date: Fri, 13 May 2016 11:04:38 -0700 Subject: [PATCH] Update stack bounds for fullscreen if rotated after updateDisplayInfo Rotation could change again after updateDisplayInfo is called. We need to set stack bounds even for fullscreen stacks in this case. Otherwise the bounds will be incorrect until it's rotated again. bug: 28611814 Change-Id: I31289524a9ceacaaaa66924e9bf6cbe88fd83f99 --- .../core/java/com/android/server/wm/TaskStack.java | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/services/core/java/com/android/server/wm/TaskStack.java b/services/core/java/com/android/server/wm/TaskStack.java index 58468f62eefb6..c54f02179d792 100644 --- a/services/core/java/com/android/server/wm/TaskStack.java +++ b/services/core/java/com/android/server/wm/TaskStack.java @@ -383,12 +383,6 @@ public class TaskStack implements DimLayer.DimLayerUser, } private boolean updateBoundsAfterConfigChange() { - if (mFullscreen) { - // Bounds will already be set correctly when display info is updated in the case of - // fullscreen. - return false; - } - final int newRotation = getDisplayInfo().rotation; final int newDensity = getDisplayInfo().logicalDensityDpi; @@ -397,6 +391,13 @@ public class TaskStack implements DimLayer.DimLayerUser, return false; } + if (mFullscreen) { + // Update stack bounds again since rotation changed since updateDisplayInfo(). + setBounds(null); + // Return false since we don't need the client to resize. + return false; + } + final int oldDockSide = mStackId == DOCKED_STACK_ID ? getDockSide() : DOCKED_INVALID; mTmpRect2.set(mBounds); mDisplayContent.rotateBounds(mRotation, newRotation, mTmpRect2);