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

Commit f8a26280 authored by Hongwei Wang's avatar Hongwei Wang
Browse files

Prevent IndexOutOfBoundsException in PipTransition

Monkey test detects IndexOutOfBoundsException thrown from
PipTransition#removePipImmediately, log and bypass the
IndexOutOfBoundsException while the investigation is in progress.

Bug: 335524017
Test: N/A
Change-Id: Idfa6c2592746c696057965e21be8ed2249e046e0
parent 8554d459
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -818,8 +818,13 @@ public class PipTransition extends PipTransitionController {
            @NonNull Transitions.TransitionFinishCallback finishCallback,
            @NonNull TaskInfo taskInfo) {
        startTransaction.apply();
        if (info.getChanges().isEmpty()) {
            ProtoLog.e(ShellProtoLogGroup.WM_SHELL_PICTURE_IN_PICTURE,
                    "removePipImmediately is called with empty changes");
        } else {
            finishTransaction.setWindowCrop(info.getChanges().get(0).getLeash(),
                    mPipDisplayLayoutState.getDisplayBounds());
        }
        mPipOrganizer.onExitPipFinished(taskInfo);
        finishCallback.onTransitionFinished(null);
    }