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

Commit 06edb3e4 authored by Mateusz Cicheński's avatar Mateusz Cicheński
Browse files

Don't sync the resize callback on exiting PiP.

Bug: 276806110
Test: http://recall/-/ekEuGtt9d9HWqkUtAzpHx8/Za1oNXjybbAD91zzs4NvH

Change-Id: I0f839f0466927c4544657b3b909467c9c7c5faac
parent a1e56c40
Loading
Loading
Loading
Loading
+12 −4
Original line number Diff line number Diff line
@@ -146,12 +146,16 @@ public class PipTaskOrganizer implements ShellTaskOrganizer.TaskListener,
            t.apply();

            // execute the runnable if non-null after WCT is applied to finish resizing pip
            maybePerformFinishResizeCallback();
        }
    };

    private void maybePerformFinishResizeCallback() {
        if (mPipFinishResizeWCTRunnable != null) {
            mPipFinishResizeWCTRunnable.run();
            mPipFinishResizeWCTRunnable = null;
        }
    }
    };

    // These callbacks are called on the update thread
    private final PipAnimationController.PipAnimationCallback mPipAnimationCallback =
@@ -1606,6 +1610,10 @@ public class PipTaskOrganizer implements ShellTaskOrganizer.TaskListener,
        if (direction == TRANSITION_DIRECTION_LEAVE_PIP_TO_SPLIT_SCREEN) {
            mSplitScreenOptional.ifPresent(splitScreenController ->
                    splitScreenController.enterSplitScreen(mTaskInfo.taskId, wasPipTopLeft, wct));
        } else if (direction == TRANSITION_DIRECTION_LEAVE_PIP) {
            // when leaving PiP we can call the callback without sync
            maybePerformFinishResizeCallback();
            mTaskOrganizer.applyTransaction(wct);
        } else {
            mTaskOrganizer.applySyncTransaction(wct, mPipFinishResizeWCTCallback);
        }