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

Commit 375e47cf authored by Ikram Gabiyev's avatar Ikram Gabiyev
Browse files

Check AR state upon enter PiP collect

Since collection could be delayed if some
other sync is ongoing for a different transition
we should check if a PiP candidate activity is still
valid before collecting anything or making changes in
the TRANSIT_PIP transition and bail early if needed.

Bug: 438555132
Flag: EXEMPT bugfix
Test: N/A
Change-Id: I1b2ec865446323ae13fca413b820e2692a25471c
parent 2dfd0e66
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -4147,6 +4147,15 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub {
                }

                getTransitionController().startCollectOrQueue(enterPipTransition, (deferred) -> {
                    if (deferred && !r.checkEnterPictureInPictureState(
                            "enterPictureInPictureMode-collect", false /* beforeStopping */)) {
                        // If the transition was queued to collect, it is possible the PiP candidate
                        // activity isn't in a proper state to enter PiP anymore, so double check.
                        Slog.w(TAG, "PiP candidate activity in invalid state on transit collect");
                        enterPipTransition.abort();
                        return;
                    }

                    mChainTracker.start("enterPip2", enterPipTransition);
                    // Collecting PiP activity explicitly to avoid stopping PiP activity while
                    // Shell handles the request; see task supervisor's