Don't sync the resize callback on exiting PiP.

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

Change-Id: I0f839f0466927c4544657b3b909467c9c7c5faac
This commit is contained in:
Mateusz Cicheński
2023-04-11 02:11:10 +00:00
parent a1e56c4098
commit 06edb3e41c

View File

@@ -146,13 +146,17 @@ public class PipTaskOrganizer implements ShellTaskOrganizer.TaskListener,
t.apply();
// execute the runnable if non-null after WCT is applied to finish resizing pip
if (mPipFinishResizeWCTRunnable != null) {
mPipFinishResizeWCTRunnable.run();
mPipFinishResizeWCTRunnable = null;
}
maybePerformFinishResizeCallback();
}
};
private void maybePerformFinishResizeCallback() {
if (mPipFinishResizeWCTRunnable != null) {
mPipFinishResizeWCTRunnable.run();
mPipFinishResizeWCTRunnable = null;
}
}
// These callbacks are called on the update thread
private final PipAnimationController.PipAnimationCallback mPipAnimationCallback =
new PipAnimationController.PipAnimationCallback() {
@@ -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);
}