Don't resize PiP on aspect ratio change if nothing changed.

Aspect ratio changes could be deferred, and thus only the aspect ratio
itself needs to be updated, but the bounds itself is already correct.

Bug: 234615306
Bug: 241096069
Test: Enter PiP and move it around right after animation finishes
Change-Id: Ia1078a6492358e694d4eadf97fa0f242a4033c6f
This commit is contained in:
Ben Lin
2022-08-01 12:52:03 -07:00
parent a6e81f5739
commit d9df20c23f

View File

@@ -495,14 +495,15 @@ public class PipController implements PipTransitionController.PipTransitionCallb
mPipBoundsState.getBounds(),
mPipBoundsState.getAspectRatio());
Objects.requireNonNull(destinationBounds, "Missing destination bounds");
mPipTaskOrganizer.scheduleAnimateResizePip(destinationBounds,
mEnterAnimationDuration,
null /* updateBoundsCallback */);
mTouchHandler.onAspectRatioChanged();
updateMovementBounds(null /* toBounds */, false /* fromRotation */,
false /* fromImeAdjustment */, false /* fromShelfAdjustment */,
null /* windowContainerTransaction */);
if (!destinationBounds.equals(mPipBoundsState.getBounds())) {
mPipTaskOrganizer.scheduleAnimateResizePip(destinationBounds,
mEnterAnimationDuration,
null /* updateBoundsCallback */);
mTouchHandler.onAspectRatioChanged();
updateMovementBounds(null /* toBounds */, false /* fromRotation */,
false /* fromImeAdjustment */, false /* fromShelfAdjustment */,
null /* windowContainerTransaction */);
}
}
@Override