Added support to specify animation duration when resizing stack

Needed for sys-ui to control the duration of various Pip transitions.

Bug: 27674339
Change-Id: I7bad27aaa19755a73c594e88b88b56db033e1a45
diff --git a/services/core/java/com/android/server/wm/BoundsAnimationController.java b/services/core/java/com/android/server/wm/BoundsAnimationController.java
index 79d3d84..b7d6062 100644
--- a/services/core/java/com/android/server/wm/BoundsAnimationController.java
+++ b/services/core/java/com/android/server/wm/BoundsAnimationController.java
@@ -214,7 +214,7 @@
         void getFullScreenBounds(Rect bounds);
     }
 
-    void animateBounds(final AnimateBoundsUser target, Rect from, Rect to) {
+    void animateBounds(final AnimateBoundsUser target, Rect from, Rect to, int animationDuration) {
         boolean moveToFullscreen = false;
         if (to == null) {
             to = new Rect();
@@ -242,7 +242,8 @@
                 new BoundsAnimator(target, from, to, moveToFullscreen, replacing);
         mRunningAnimations.put(target, animator);
         animator.setFloatValues(0f, 1f);
-        animator.setDuration(DEFAULT_APP_TRANSITION_DURATION * DEBUG_ANIMATION_SLOW_DOWN_FACTOR);
+        animator.setDuration((animationDuration != -1 ? animationDuration
+                : DEFAULT_APP_TRANSITION_DURATION) * DEBUG_ANIMATION_SLOW_DOWN_FACTOR);
         animator.setInterpolator(new LinearInterpolator());
         animator.start();
     }