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

Commit 6646820d authored by Chris Li's avatar Chris Li
Browse files

Fix janky auto-enter PiP animation from split activity

This happens to Activity Embedding split and system split screen.

When minimizing the split pair of activities with one activity auto
entering PiP. It used to keep the other split activity visible without
any animation until the entering PiP animation (bounds) is done, which
looks janky.

Ideally, the transition should be splitted so that the PiP change is
animated by the PipTransition while the rest should be picked up by
other handler. This is a short term fix to immediately hide the other
closing window.

Fix: 306988504
Test: manual testing: in three-button navigation, show AE split
      activities with auto-pip, and press home button.
Change-Id: Ib9425814d21eb419d8906f1c3580a7083c052fb3
parent 06341ecb
Loading
Loading
Loading
Loading
+11 −2
Original line number Diff line number Diff line
@@ -822,14 +822,23 @@ public class PipTransition extends PipTransitionController {
                    + "participant");
        }

        // Make sure other open changes are visible as entering PIP. Some may be hidden in
        // Transitions#setupStartState because the transition type is OPEN (such as auto-enter).
        // Make sure other non-pip changes are handled correctly.
        for (int i = info.getChanges().size() - 1; i >= 0; --i) {
            final TransitionInfo.Change change = info.getChanges().get(i);
            if (change == enterPip) continue;
            if (TransitionUtil.isOpeningType(change.getMode())) {
                // For other open changes that are visible when entering PIP, some may be hidden in
                // Transitions#setupStartState because the transition type is OPEN (such as
                // auto-enter).
                final SurfaceControl leash = change.getLeash();
                startTransaction.show(leash).setAlpha(leash, 1.f);
            } else if (TransitionUtil.isClosingType(change.getMode())) {
                // For other close changes that are invisible as entering PIP, hide them immediately
                // to avoid showing a freezing surface.
                // Ideally, we should let other handler to handle them (likely RemoteHandler by
                // Launcher).
                final SurfaceControl leash = change.getLeash();
                startTransaction.hide(leash);
            }
        }