Also check PiP activity visibility to determine if enter-pip

Originally assumed that we could detect "commit to transient-launch"
by the transient-launch task being visible at transition end; however,
because we can't defer activity launches, if an activity launches
after recents finishes, but before its finishTransition runs, the
launcher may actually be visREquested=false and we'd then skip
entering pip.

Resolve this by also checking if the pip app became invisible during
the transient-launch. This way, if either is true, we'll enter pip.

Bug: 286729035
Test: swipe maps navigation to pip and, before anim finishes, launch
      an app.
Change-Id: Ib4a1a199093f3266148ace0443eb800f69606cef
This commit is contained in:
Evan Rosky
2023-06-20 16:54:25 -07:00
parent 88bcdd1ed9
commit 34cf703bdb

View File

@@ -979,7 +979,7 @@ class Transition implements BLASTSyncEngine.TransactionReadyListener {
}
if (ar.pictureInPictureArgs != null && ar.pictureInPictureArgs.isAutoEnterEnabled()) {
if (didCommitTransientLaunch()) {
if (!ar.getTask().isVisibleRequested() || didCommitTransientLaunch()) {
// force enable pip-on-task-switch now that we've committed to actually launching
// to the transient activity.
ar.supportsEnterPipOnTaskSwitch = true;
@@ -1008,7 +1008,8 @@ class Transition implements BLASTSyncEngine.TransactionReadyListener {
}
// Legacy pip-entry (not via isAutoEnterEnabled).
if (didCommitTransientLaunch() && ar.supportsPictureInPicture()) {
if ((!ar.getTask().isVisibleRequested() || didCommitTransientLaunch())
&& ar.supportsPictureInPicture()) {
// force enable pip-on-task-switch now that we've committed to actually launching to the
// transient activity, and then recalculate whether we can attempt pip.
ar.supportsEnterPipOnTaskSwitch = true;