From dc4915de60d403bd29d690774c8e8a86f6b42505 Mon Sep 17 00:00:00 2001 From: Riddle Hsu Date: Tue, 11 May 2021 20:56:12 +0800 Subject: [PATCH] Use rotation animation for visible wallpaper rotation Although the activity may show in next rotation directly, the wallpaper was shown in different orientation. If there is no animation to cover the change, there will be obvious jump cut that looks flickering. Bug: 187149609 Test: 1. Enable launcher rotation and auto rotation 2. Put device in landscape 3. Lock and unlock screen There will be a rotation animation. Change-Id: I5048d0c7597cdc5c9a84fa4a3b7d6feea80892ee --- services/core/java/com/android/server/wm/DisplayContent.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/services/core/java/com/android/server/wm/DisplayContent.java b/services/core/java/com/android/server/wm/DisplayContent.java index a10847876ab6a..016e9489e0ea6 100644 --- a/services/core/java/com/android/server/wm/DisplayContent.java +++ b/services/core/java/com/android/server/wm/DisplayContent.java @@ -1569,6 +1569,10 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp // If the transition has not started yet, the activity must be the top. return false; } + if (mLastWallpaperVisible && r.windowsCanBeWallpaperTarget()) { + // Use normal rotation animation for orientation change of visible wallpaper. + return false; + } final int rotation = rotationForActivityInDifferentOrientation(r); if (rotation == ROTATION_UNDEFINED) { // The display rotation won't be changed by current top activity. The client side