diff options
| author | 2021-05-18 00:14:19 +0800 | |
|---|---|---|
| committer | 2021-05-18 11:39:16 +0800 | |
| commit | 89f313fce1f633d08c46cb905cfaefa5e9e9ba33 (patch) | |
| tree | 41e99c3b831bb421f15c3cbf4596c8c7dcc6112a | |
| parent | 63a1453832f1023c65dee59b7075949810a086c1 (diff) | |
Only fade window token on exact rotation change
The rotation animation may apply without rotation degree change
to freeze display for display configuration change. The duration
is shorter so it is unnecessary to fade for covering frozen time.
Bug: 185403130
Test: DisplayContentTests#testHybridRotationAnimation
Test: Toggle dark theme from quick setting.
The notification shade should not disappear a while.
Change-Id: Ia943a9025bb4ab4a7e804e5e67648c9e8302a77b
| -rw-r--r-- | services/core/java/com/android/server/wm/DisplayContent.java | 2 | ||||
| -rw-r--r-- | services/tests/wmtests/src/com/android/server/wm/DisplayContentTests.java | 1 |
2 files changed, 3 insertions, 0 deletions
diff --git a/services/core/java/com/android/server/wm/DisplayContent.java b/services/core/java/com/android/server/wm/DisplayContent.java index 52317d9477aa..26f0706977ea 100644 --- a/services/core/java/com/android/server/wm/DisplayContent.java +++ b/services/core/java/com/android/server/wm/DisplayContent.java @@ -2998,6 +2998,8 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp // Hide the windows which are not significant in rotation animation. So that the windows // don't need to block the unfreeze time. if (screenRotationAnimation != null && screenRotationAnimation.hasScreenshot() + // Do not fade for freezing without rotation change. + && mDisplayRotation.getRotation() != getWindowConfiguration().getRotation() && mFadeRotationAnimationController == null) { startFadeRotationAnimation(false /* shouldDebounce */); } diff --git a/services/tests/wmtests/src/com/android/server/wm/DisplayContentTests.java b/services/tests/wmtests/src/com/android/server/wm/DisplayContentTests.java index ff4e5a60faac..48595699d1ad 100644 --- a/services/tests/wmtests/src/com/android/server/wm/DisplayContentTests.java +++ b/services/tests/wmtests/src/com/android/server/wm/DisplayContentTests.java @@ -1275,6 +1275,7 @@ public class DisplayContentTests extends WindowTestsBase { // Assume that the display rotation is changed so it is frozen in preparation for animation. doReturn(true).when(rotationAnim).hasScreenshot(); mWm.mDisplayFrozen = true; + displayContent.getDisplayRotation().setRotation((displayContent.getRotation() + 1) % 4); displayContent.setRotationAnimation(rotationAnim); // The fade rotation animation also starts to hide some non-app windows. assertNotNull(displayContent.getFadeRotationAnimationController()); |