From 69016e3472e9ba1144bfccd0217f7cf73b84f9ef Mon Sep 17 00:00:00 2001 From: Robert Carr Date: Mon, 18 Apr 2016 11:52:21 -0700 Subject: [PATCH] Do not prematurely update position while bounds animating. We intend to update the task size in onAnimationStart so that we can get a new buffer as quickly as possible. We need to keep it at the old position though, or we will see a jump at the beginning of the animation. Bug: 28091556 Change-Id: I5fc5f9eef1629dea88844cf3f2274eaa48909b97 --- .../android/server/wm/BoundsAnimationController.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/services/core/java/com/android/server/wm/BoundsAnimationController.java b/services/core/java/com/android/server/wm/BoundsAnimationController.java index eacdd811592b1..debb382578174 100644 --- a/services/core/java/com/android/server/wm/BoundsAnimationController.java +++ b/services/core/java/com/android/server/wm/BoundsAnimationController.java @@ -129,15 +129,19 @@ public class BoundsAnimationController { public void onAnimationStart(Animator animation) { if (DEBUG) Slog.d(TAG, "onAnimationStart: mTarget=" + mTarget + " mReplacement=" + mReplacement); + // Ensure that we have prepared the target for animation before + // we trigger any size changes, so it can swap surfaces + // in to appropriate modes, or do as it wishes otherwise. if (!mReplacement) { mTarget.onAnimationStart(); } - // Ensure that we have prepared the target for animation before - // we trigger any size changes, so it can swap surfaces - // in to appropriate modes, or do as it wishes otherwise. + // Immediately update the task bounds if they have to become larger, but preserve + // the starting position so we don't jump at the beginning of the animation. if (animatingToLargerSize()) { - mTarget.setPinnedStackSize(mFrom, mTo); + mTmpRect.set(mFrom.left, mFrom.top, + mFrom.left + mFrozenTaskWidth, mFrom.top + mFrozenTaskHeight); + mTarget.setPinnedStackSize(mFrom, mTmpRect); } }