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

Commit 357dbd8a authored by Ikram Gabiyev's avatar Ikram Gabiyev
Browse files

Check AR attached 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
attached 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: I7ce72c2b802f2508ace2a45e074116961c317649
parent 21492f3d
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -4183,6 +4183,14 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub {
                }

                getTransitionController().startCollectOrQueue(enterPipTransition, (deferred) -> {
                    if (deferred && !r.isAttached()) {
                        // 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