Detect 3p launcher move-to-front during recents.

If entering recents with a 3p launcher below a translucent task,
the 3p launcher will remain visible the whole time. This means
that, upon "committing" to go home (swipe-to-home), the 3p
launcher task will be brought to-front rather than launched. If,
we don't check for this, the default behavior of Recents handler
is to cancel the current recents transition if it sees a
transition with unrecognized stuff that isn't related to it's
session.

So, add a check for 3p launcher moving-to-front and convert it
into an "open" so the rest of recents treats it as such.

Bug: 284195706
Test: add calendar widget to 3p launcher, open an event,
      swipe-to-home.
Change-Id: I81cd2a69858f4e20fe0bf86be94ca0e2af06fc28
This commit is contained in:
Evan Rosky
2023-06-07 21:07:29 -07:00
parent 4b9f5eb5ea
commit 1344b16208

View File

@@ -598,6 +598,17 @@ public class RecentsTransitionHandler implements Transitions.TransitionHandler {
// Don't consider order-only changes as changing apps.
if (!TransitionUtil.isOrderOnly(change)) {
hasChangingApp = true;
} else if (isLeafTask && taskInfo.topActivityType == ACTIVITY_TYPE_HOME
&& !mRecentsTask.equals(change.getContainer())) {
// Unless it is a 3p launcher. This means that the 3p launcher was already
// visible (eg. the "pausing" task is translucent over the 3p launcher).
// Treat it as if we are "re-opening" the 3p launcher.
if (openingTasks == null) {
openingTasks = new ArrayList<>();
openingTaskIsLeafs = new IntArray();
}
openingTasks.add(change);
openingTaskIsLeafs.add(1);
}
}
}