Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 87092731 authored by Riddle Hsu's avatar Riddle Hsu
Browse files

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
parent dd218cba
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -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;
                }
            }