diff options
| author | 2023-03-01 15:40:20 +0800 | |
|---|---|---|
| committer | 2023-03-01 15:40:47 +0800 | |
| commit | 870927314e29d7428e34b9e35c5c1a364582c2df (patch) | |
| tree | b357b42efa46b0a7727470fc906dc871de79889b | |
| parent | dd218cbaf8b16fe610f40de8d640c7b822a43ca1 (diff) | |
Preempt recents animation if display is changed
This aligns the same behavior as [1]. Then the recents animation
can be finished, and the animating activity can be stopped with
a screenshot as the replacement. So the default rotation transition
animation can continue to play.
[1]:I41278e78b491c4b956e49b8b1fea40b470252aab
Bug: 271099935
Test: Enable rotation for launcher.
Launch app and rotate to landscape and enter recents.
Rotate to portrait.
There should be a normal rotation animation
Change-Id: Ieb9ccb13ad0b4bdad880c4c90388cdd75affef34
| -rw-r--r-- | packages/SystemUI/shared/src/com/android/systemui/shared/system/RemoteTransitionCompat.java | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/packages/SystemUI/shared/src/com/android/systemui/shared/system/RemoteTransitionCompat.java b/packages/SystemUI/shared/src/com/android/systemui/shared/system/RemoteTransitionCompat.java index 2a37bd370b7c..488a675d5ca2 100644 --- a/packages/SystemUI/shared/src/com/android/systemui/shared/system/RemoteTransitionCompat.java +++ b/packages/SystemUI/shared/src/com/android/systemui/shared/system/RemoteTransitionCompat.java @@ -219,6 +219,13 @@ public class RemoteTransitionCompat { foundRecentsClosing = true; } } else if (change.getMode() == TRANSIT_CHANGE) { + // Finish recents animation if the display is changed, so the default + // transition handler can play the animation such as rotation effect. + if (change.hasFlags(TransitionInfo.FLAG_IS_DISPLAY)) { + mListener.onSwitchToScreenshot(() -> finish(false /* toHome */, + false /* userLeaveHint */)); + return false; + } hasChangingApp = true; } } |