From faf59661282d73449593e5f240717b7361f8bed6 Mon Sep 17 00:00:00 2001 From: Riddle Hsu Date: Tue, 10 Aug 2021 15:31:40 +0800 Subject: [PATCH] Allow to use fixed rotation if recents is animating The condition of visible wallpaper was added for transition between lockscreen and home that show wallpaper in different orientation. But that also affects when swiping to home if the recents activity is not home activity (3rd party launcher). And it will cause additional rotation animation which looks unpolished. This restores the case to have the same behavior as R. Bug: 196012011 Test: Use 3rd party launcher as default home and gesture navigation. Swipe to home from an app which has different orientation from the launcher. There should be no rotation animation. Change-Id: I8a3b4617434c619463a96b9e3106d25654a55391 --- .../core/java/com/android/server/wm/DisplayContent.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/services/core/java/com/android/server/wm/DisplayContent.java b/services/core/java/com/android/server/wm/DisplayContent.java index 1b799dfbdaabf..dbc1116ad3890 100644 --- a/services/core/java/com/android/server/wm/DisplayContent.java +++ b/services/core/java/com/android/server/wm/DisplayContent.java @@ -1593,8 +1593,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. + if (mLastWallpaperVisible && r.windowsCanBeWallpaperTarget() + && mFixedRotationTransitionListener.mAnimatingRecents == null) { + // Use normal rotation animation for orientation change of visible wallpaper if recents + // animation is not running (it may be swiping to home). return false; } final int rotation = rotationForActivityInDifferentOrientation(r);