From e441e7f15f28c4281e18eba339755344809ce6e7 Mon Sep 17 00:00:00 2001 From: Robert Carr Date: Wed, 12 Oct 2016 12:48:13 -0700 Subject: [PATCH] Correct recently introduced logic error in seamless rotation detection. The code detecting whether we should rotate seamlessly (which for example we do not support for 180 degree rotations) was moved to before mRotation was updated, so it was always passing the same value for old and new rotation, and we were failing to perform the 180 degree rotation check. Correct this. Test: Rotate the device 180 degrees at once while in Camera. Things look ok. Bug: 32025371 Change-Id: I0ef08e8cc4e5d87fdff6d839381196c2b52e71d5 --- .../core/java/com/android/server/wm/WindowManagerService.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/services/core/java/com/android/server/wm/WindowManagerService.java b/services/core/java/com/android/server/wm/WindowManagerService.java index 7a73759f03886..ca2610af3f661 100644 --- a/services/core/java/com/android/server/wm/WindowManagerService.java +++ b/services/core/java/com/android/server/wm/WindowManagerService.java @@ -6831,7 +6831,8 @@ public class WindowManagerService extends IWindowManager.Stub final WindowList windows = displayContent.getWindowList(); final int oldRotation = mRotation; - boolean rotateSeamlessly = mPolicy.shouldRotateSeamlessly(oldRotation, mRotation); + int rotation = mPolicy.rotationForOrientationLw(mLastOrientation, mRotation); + boolean rotateSeamlessly = mPolicy.shouldRotateSeamlessly(oldRotation, rotation); if (rotateSeamlessly) { for (int i = windows.size() - 1; i >= 0; i--) { @@ -6864,7 +6865,6 @@ public class WindowManagerService extends IWindowManager.Stub // an orientation that has different metrics than it expected. // eg. Portrait instead of Landscape. - int rotation = mPolicy.rotationForOrientationLw(mLastOrientation, mRotation); boolean altOrientation = !mPolicy.rotationHasCompatibleMetricsLw( mLastOrientation, rotation);