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

Commit 1333ee4b 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 am: 78067c07

parents 1780ec2a 78067c07
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);
        }