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
This commit is contained in:
Riddle Hsu
2021-08-10 15:31:40 +08:00
parent 8d26ea92b4
commit faf5966128

View File

@@ -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);