Loading libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipMotionHelper.java +6 −14 Original line number Diff line number Diff line Loading @@ -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 Loading Loading @@ -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(), Loading Loading @@ -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 Loading @@ -673,16 +675,6 @@ public class PipMotionHelper implements PipAppOpsListener.Callback, cleanUpHighPerfSessionMaybe(); } /** * 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}. */ Loading Loading @@ -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); } /** Loading Loading
libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipMotionHelper.java +6 −14 Original line number Diff line number Diff line Loading @@ -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 Loading Loading @@ -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(), Loading Loading @@ -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 Loading @@ -673,16 +675,6 @@ public class PipMotionHelper implements PipAppOpsListener.Callback, cleanUpHighPerfSessionMaybe(); } /** * 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}. */ Loading Loading @@ -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); } /** Loading