From 4a3258fa1dfc030ef22cb0bd1b1ab0afa71c9392 Mon Sep 17 00:00:00 2001 From: Robert Carr Date: Thu, 29 Dec 2016 15:58:14 -0800 Subject: [PATCH] Do not wait for configuration when it won't change. When updating orientation the configuration won't change if we are rotating 180 degrees. It seems previously there were redundant calls to setNewConfiguration et. al. clearing this flag. Those aren't happening anymore, so it doesn't get cleared, leaving the screen frozen. Test: Manual repro of bug steps. Bug: 33956442 Change-Id: I01c612a6d7f920ad7abf64aa97558bebde6bb49c --- .../java/com/android/server/wm/WindowManagerService.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/services/core/java/com/android/server/wm/WindowManagerService.java b/services/core/java/com/android/server/wm/WindowManagerService.java index 0f1675098c186..2ade924bf77d5 100644 --- a/services/core/java/com/android/server/wm/WindowManagerService.java +++ b/services/core/java/com/android/server/wm/WindowManagerService.java @@ -4831,6 +4831,10 @@ public class WindowManagerService extends IWindowManager.Stub + (altOrientation ? " (alt)" : "") + " from " + mRotation + (mAltOrientation ? " (alt)" : "") + ", lastOrientation=" + mLastOrientation); + if (DisplayContent.deltaRotation(rotation, mRotation) != 2) { + mWaitingForConfig = true; + } + mRotation = rotation; mAltOrientation = altOrientation; mPolicy.setRotationLw(mRotation); @@ -4838,7 +4842,7 @@ public class WindowManagerService extends IWindowManager.Stub mWindowsFreezingScreen = WINDOWS_FREEZING_SCREENS_ACTIVE; mH.removeMessages(H.WINDOW_FREEZE_TIMEOUT); mH.sendEmptyMessageDelayed(H.WINDOW_FREEZE_TIMEOUT, WINDOW_FREEZE_TIMEOUT_DURATION); - mWaitingForConfig = true; + dc.setLayoutNeeded(); final int[] anim = new int[2]; if (dc.isDimming()) {