diff options
| author | 2022-08-01 12:52:03 -0700 | |
|---|---|---|
| committer | 2022-08-02 12:51:57 -0700 | |
| commit | d9df20c23f30be9b2f9c17aae794ea7662fd682d (patch) | |
| tree | bb19ad03867e3efbbb738be23ace0176bbb174ad | |
| parent | a6e81f57393be87852b791addfe48ca8f533108b (diff) | |
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
| -rw-r--r-- | libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipController.java | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipController.java b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipController.java index 420d6067f420..586e3a014506 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipController.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipController.java @@ -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 |