From 3f3f5fcc22010f984421afc637db559619b1fd29 Mon Sep 17 00:00:00 2001 From: Riddle Hsu Date: Fri, 7 May 2021 22:11:41 +0800 Subject: [PATCH] Allow screen rotation animation when entering AOD If the device supports AOD2, the device can sleep without turning off screen. If device is sleeping, DisplayPolicy#isAwake will be false that causes reject to animate. And if display orientation is changed, the intermediate state of windows are shown directly that looks flickering. Bug: 187149609 Test: Enable "Lock screen" -> "Always show time and info" Put launcher in landscape and turn off screen. The rotation animation should cover the windows which are redrawing for orientating change. Change-Id: I915026563254bf1c79b0e859f502014a60f9236e --- .../core/java/com/android/server/policy/PhoneWindowManager.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/core/java/com/android/server/policy/PhoneWindowManager.java b/services/core/java/com/android/server/policy/PhoneWindowManager.java index 27f5350661f0b..3e98b2f4063e8 100644 --- a/services/core/java/com/android/server/policy/PhoneWindowManager.java +++ b/services/core/java/com/android/server/policy/PhoneWindowManager.java @@ -4494,7 +4494,7 @@ public class PhoneWindowManager implements WindowManagerPolicy { @Override public boolean okToAnimate(boolean ignoreScreenOn) { - return (ignoreScreenOn || mDefaultDisplayPolicy.isAwake()) && !mDeviceGoingToSleep; + return (ignoreScreenOn || isScreenOn()) && !mDeviceGoingToSleep; } /** {@inheritDoc} */