summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipMotionHelper.java20
1 files changed, 6 insertions, 14 deletions
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipMotionHelper.java b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipMotionHelper.java
index 82fbfadc162a..5710af645a73 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipMotionHelper.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipMotionHelper.java
@@ -204,8 +204,7 @@ public class PipMotionHelper implements PipAppOpsListener.Callback,
@NonNull
@Override
public Rect getFloatingBoundsOnScreen() {
- return !mPipBoundsState.getMotionBoundsState().getAnimatingToBounds().isEmpty()
- ? mPipBoundsState.getMotionBoundsState().getAnimatingToBounds() : getBounds();
+ return getBounds();
}
@NonNull
@@ -616,7 +615,7 @@ public class PipMotionHelper implements PipAppOpsListener.Callback,
cancelPhysicsAnimation();
}
- setAnimatingToBounds(new Rect(
+ mPipBoundsState.getMotionBoundsState().setAnimatingToBounds(new Rect(
(int) toX,
(int) toY,
(int) toX + getBounds().width(),
@@ -660,6 +659,9 @@ public class PipMotionHelper implements PipAppOpsListener.Callback,
// All motion operations have actually finished.
mPipBoundsState.setBounds(
mPipBoundsState.getMotionBoundsState().getBoundsInMotion());
+ // Notifies the floating coordinator that we moved, so we return these bounds from
+ // {@link FloatingContentCoordinator.FloatingContent#getFloatingBoundsOnScreen()}.
+ mFloatingContentCoordinator.onContentMoved(this);
mPipBoundsState.getMotionBoundsState().onAllAnimationsEnded();
if (!mDismissalPending) {
// do not schedule resize if PiP is dismissing, which may cause app re-open to
@@ -674,16 +676,6 @@ public class PipMotionHelper implements PipAppOpsListener.Callback,
}
/**
- * Notifies the floating coordinator that we're moving, and sets the animating to bounds so
- * we return these bounds from
- * {@link FloatingContentCoordinator.FloatingContent#getFloatingBoundsOnScreen()}.
- */
- private void setAnimatingToBounds(Rect bounds) {
- mPipBoundsState.getMotionBoundsState().setAnimatingToBounds(bounds);
- mFloatingContentCoordinator.onContentMoved(this);
- }
-
- /**
* Directly resizes the PiP to the given {@param bounds}.
*/
private void resizePipUnchecked(Rect toBounds) {
@@ -712,7 +704,7 @@ public class PipMotionHelper implements PipAppOpsListener.Callback,
// This is so all the proper callbacks are performed.
mPipTaskOrganizer.scheduleAnimateResizePip(toBounds, duration,
TRANSITION_DIRECTION_EXPAND_OR_UNEXPAND, null /* updateBoundsCallback */);
- setAnimatingToBounds(toBounds);
+ mPipBoundsState.getMotionBoundsState().setAnimatingToBounds(toBounds);
}
/**