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

Commit 1f7ae9d3 authored by Mateusz Cicheński's avatar Mateusz Cicheński Committed by Automerger Merge Worker
Browse files

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

parents 55fb4e74 354a2876
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);
        }