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

Commit c4723dc2 authored by Ikram Gabiyev's avatar Ikram Gabiyev
Browse files

Force set to entered state to avoid overflow

Force set the PiP transition state to ENTERED_PIP
before recursively calling exitPip() while ENTERING_PIP
in an attempt to start exiting PiP
(e.g. due to onActivityRestartAttempt).

This should help avoid potential stack overflow errors.

Bug: 345686267
Test: direct enter PiP and tap to expand quickly
Change-Id: Ie0ad45f2ff1892257e4c95e211e5dd5b4826d5f6
parent 48459cba
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -603,6 +603,8 @@ public class PipTaskOrganizer implements ShellTaskOrganizer.TaskListener,
            // the end of the enter animation and reschedule exitPip to run after enter-PiP
            // has finished its transition and allowed the client to draw in PiP mode.
            mPipTransitionController.end(() -> {
                // TODO(341627042): force set to entered state to avoid potential stack overflow.
                mPipTransitionState.setTransitionState(PipTransitionState.ENTERED_PIP);
                exitPip(animationDurationMs, requestEnterSplit);
            });
            return;