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

Commit fdef0a8c authored by Riddle Hsu's avatar Riddle Hsu
Browse files

Do not set crop when removing pip

Actually the finishTransaction already contains the end state crop
which was set by wm.Transition#resetSurfaceTransform.

This also avoids setting unexpected crop to unrelated task if the
transition info contains other non pip task.

Bug: 340367710
Test: Dismiss pip and launch it again.
Change-Id: I110d1c11f3d3fdcfb83698e5cf1ec4efb062bd10
parent b972663f
Loading
Loading
Loading
Loading
+3 −5
Original line number Diff line number Diff line
@@ -824,12 +824,10 @@ public class PipTransition extends PipTransitionController {
            @NonNull Transitions.TransitionFinishCallback finishCallback,
            @NonNull TaskInfo taskInfo) {
        startTransaction.apply();
        if (info.getChanges().isEmpty()) {
        final TransitionInfo.Change pipChange = findCurrentPipTaskChange(info);
        if (pipChange == null) {
            ProtoLog.e(ShellProtoLogGroup.WM_SHELL_PICTURE_IN_PICTURE,
                    "removePipImmediately is called with empty changes");
        } else {
            finishTransaction.setWindowCrop(info.getChanges().get(0).getLeash(),
                    mPipDisplayLayoutState.getDisplayBounds());
                    "removePipImmediately is called without pip change");
        }
        mPipOrganizer.onExitPipFinished(taskInfo);
        finishCallback.onTransitionFinished(null);