Deprecates the animatingBounds from WM to SysUI

PipTouchHandler, similar to other components in SysUI, should be in-sync
with the destination bounds calculated within SysUI rather than WM.

Fixed also the empty movement bounds upon the first call to
PipTouchHandler#onMovementBoundsChanged. Together, this change should
fix the PIP not being lifted on IME show up. PipTouchHandlerTest is
updated correspondingly.

Bug: 153352899
Test: manually enter/exit PiP
Test: atest PipTouchHandlerTest
Change-Id: I2912af2a181b7fb57c6d90751744d46c6b3366d2
diff --git a/packages/SystemUI/src/com/android/systemui/pip/PipTaskOrganizer.java b/packages/SystemUI/src/com/android/systemui/pip/PipTaskOrganizer.java
index d2994ae..a95d6b7 100644
--- a/packages/SystemUI/src/com/android/systemui/pip/PipTaskOrganizer.java
+++ b/packages/SystemUI/src/com/android/systemui/pip/PipTaskOrganizer.java
@@ -317,17 +317,22 @@
 
     /**
      * TODO(b/152809058): consolidate the display info handling logic in SysUI
+     *
+     * @param destinationBoundsOut the current destination bounds will be populated to this param
      */
     @SuppressWarnings("unchecked")
-    public void onMovementBoundsChanged(boolean fromImeAdjustment, boolean fromShelfAdjustment) {
+    public void onMovementBoundsChanged(Rect destinationBoundsOut,
+            boolean fromImeAdjustment, boolean fromShelfAdjustment) {
         final PipAnimationController.PipTransitionAnimator animator =
                 mPipAnimationController.getCurrentAnimator();
+        destinationBoundsOut.set(mLastReportedBounds);
         if (animator == null || !animator.isRunning()
                 || animator.getTransitionDirection() != TRANSITION_DIRECTION_TO_PIP) {
             return;
         }
 
         final Rect currentDestinationBounds = animator.getDestinationBounds();
+        destinationBoundsOut.set(currentDestinationBounds);
         if (!fromImeAdjustment && !fromShelfAdjustment
                 && mPipBoundsHandler.getDisplayBounds().contains(currentDestinationBounds)) {
             // no need to update the destination bounds, bail early
@@ -342,6 +347,7 @@
             animator.updateEndValue(newDestinationBounds);
         }
         animator.setDestinationBounds(newDestinationBounds);
+        destinationBoundsOut.set(newDestinationBounds);
     }
 
     /**