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
This commit is contained in:
Evan Rosky
2023-06-26 17:08:58 -07:00
parent 37ccbe7384
commit fffe0f3c40

View File

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