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

Commit 354a2876 authored by Mateusz Cicheński's avatar Mateusz Cicheński Committed by Android (Google) Code Review
Browse files

Merge "Don't sync the resize callback on exiting PiP." into udc-dev

parents 237a1061 06edb3e4
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 =
@@ -1607,6 +1611,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);
        }