summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Mateusz Cicheński <mateuszc@google.com> 2023-03-27 23:14:07 +0000
committer Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> 2023-03-27 23:14:07 +0000
commitdb11b1cef16a8601fdade5d2f44545d5a8451626 (patch)
tree66fc652e0f10bb0f474bec6bf4980c6aca91399c
parenta4dbeb64ce694e212990be3abe92bdcdac31f006 (diff)
parent6a2a8f53c27d67b55cb7ba6c634b50c0c0600882 (diff)
Merge "Fix enter pip animation in fixed rotation with KCA flag on" into tm-qpr-dev am: 6a2a8f53c2
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/22272929 Change-Id: I6842194993916ba273c884248a94632e3fea171b Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
-rw-r--r--libs/WindowManager/Shell/src/com/android/wm/shell/pip/PipTaskOrganizer.java27
1 files changed, 12 insertions, 15 deletions
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/PipTaskOrganizer.java b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/PipTaskOrganizer.java
index 7e9f2c53d04b..016ca3370358 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/PipTaskOrganizer.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/PipTaskOrganizer.java
@@ -1178,20 +1178,7 @@ public class PipTaskOrganizer implements ShellTaskOrganizer.TaskListener,
final Rect newDestinationBounds = mPipBoundsAlgorithm.getEntryDestinationBounds();
if (newDestinationBounds.equals(currentDestinationBounds)) return;
- if (animator.getAnimationType() == ANIM_TYPE_BOUNDS) {
- if (mWaitForFixedRotation) {
- // The new destination bounds are in next rotation (DisplayLayout has been rotated
- // in computeRotatedBounds). The animation runs in previous rotation so the end
- // bounds need to be transformed.
- final Rect displayBounds = mPipBoundsState.getDisplayBounds();
- final Rect rotatedEndBounds = new Rect(newDestinationBounds);
- rotateBounds(rotatedEndBounds, displayBounds, mNextRotation, mCurrentRotation);
- animator.updateEndValue(rotatedEndBounds);
- } else {
- animator.updateEndValue(newDestinationBounds);
- }
- }
- animator.setDestinationBounds(newDestinationBounds);
+ updateAnimatorBounds(newDestinationBounds);
destinationBoundsOut.set(newDestinationBounds);
}
@@ -1203,7 +1190,17 @@ public class PipTaskOrganizer implements ShellTaskOrganizer.TaskListener,
mPipAnimationController.getCurrentAnimator();
if (animator != null && animator.isRunning()) {
if (animator.getAnimationType() == ANIM_TYPE_BOUNDS) {
- animator.updateEndValue(bounds);
+ if (mWaitForFixedRotation) {
+ // The new destination bounds are in next rotation (DisplayLayout has been
+ // rotated in computeRotatedBounds). The animation runs in previous rotation so
+ // the end bounds need to be transformed.
+ final Rect displayBounds = mPipBoundsState.getDisplayBounds();
+ final Rect rotatedEndBounds = new Rect(bounds);
+ rotateBounds(rotatedEndBounds, displayBounds, mNextRotation, mCurrentRotation);
+ animator.updateEndValue(rotatedEndBounds);
+ } else {
+ animator.updateEndValue(bounds);
+ }
}
animator.setDestinationBounds(bounds);
}