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

Commit fffe0f3c authored by Evan Rosky's avatar Evan Rosky
Browse files

Don't commit invisible on a collecting transient-launch task

The visibleAtTransitionEnd mechanism can't be used for
transient-launch; however, we need to avoid the same problem
that it prevents (premutarely committing invisible on a
window that was not hidden by the current transition but
instead a later one).

This CL adds a heuristic for the transient-launch case that
serves a similar purpose.

Bug: 280907903
Test: inject a sleep during finish to ensure that you can
      launch an app before finishing swipe-to-home. Then
      swipe to home and open another app immediately.
Change-Id: I8b3374040c60068d08905b5d2c604b7c250afccf
parent 37ccbe73
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -1093,6 +1093,16 @@ class Transition implements BLASTSyncEngine.TransactionReadyListener {
                final Task task = ar.getTask();
                if (task == null) continue;
                boolean visibleAtTransitionEnd = mVisibleAtTransitionEndTokens.contains(ar);
                // visibleAtTransitionEnd is used to guard against pre-maturely committing
                // invisible on a window which is actually hidden by a later transition and not this
                // one. However, for a transient launch, we can't use this mechanism because the
                // visibility is determined at finish. Instead, use a different heuristic: don't
                // commit invisible if the window is already in a later transition. That later
                // transition will then handle the commit.
                if (isTransientLaunch(ar) && !ar.isVisibleRequested()
                        && mController.inCollectingTransition(ar)) {
                    visibleAtTransitionEnd = true;
                }
                // We need both the expected visibility AND current requested-visibility to be
                // false. If it is expected-visible but not currently visible, it means that
                // another animation is queued-up to animate this to invisibility, so we can't