From e54dbef9afcba0ccfcb0d49cfef39b256a77fe7a Mon Sep 17 00:00:00 2001 From: Ming-Shin Lu Date: Mon, 18 May 2020 10:19:20 +0800 Subject: Set correct screenBounds for RemoteAnimation Fix WindowContainer#getAnimationAdapter that creating RemoteAnimationRecord set wrong parameter for screenBounds. This can correct the position of split-screen task launching animation that may shifted because the initial task view in launcher side is base on screen coordinate. Fix: 153581126 Test: manual as below steps: 1) Launch a app, swipe up to overview screen. 2) Tap app icon and pressing "Split screen" item. 3) After entered split-screen mode, taps the task view. 4) Make sure the secondary task animation the movement is correct and smoothly. Change-Id: I793f01fb290fe65af1bbf8e29e429fbca63ac255 --- services/core/java/com/android/server/wm/WindowContainer.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/services/core/java/com/android/server/wm/WindowContainer.java b/services/core/java/com/android/server/wm/WindowContainer.java index 7bfddd79f8a4..fb2c22ebae42 100644 --- a/services/core/java/com/android/server/wm/WindowContainer.java +++ b/services/core/java/com/android/server/wm/WindowContainer.java @@ -2182,7 +2182,8 @@ class WindowContainer extends ConfigurationContainer< final int appStackClipMode = getDisplayContent().mAppTransition.getAppStackClipMode(); // Separate position and size for use in animators. - mTmpRect.set(getAnimationBounds(appStackClipMode)); + final Rect screenBounds = getAnimationBounds(appStackClipMode); + mTmpRect.set(screenBounds); getAnimationPosition(mTmpPoint); if (!sHierarchicalAnimations) { // Non-hierarchical animation uses position in global coordinates. @@ -2201,7 +2202,7 @@ class WindowContainer extends ConfigurationContainer< localBounds.offsetTo(mTmpPoint.x, mTmpPoint.y); final RemoteAnimationController.RemoteAnimationRecord adapters = controller.createRemoteAnimationRecord(this, mTmpPoint, localBounds, - mTmpRect, (isChanging ? mSurfaceFreezer.mFreezeBounds : null)); + screenBounds, (isChanging ? mSurfaceFreezer.mFreezeBounds : null)); resultAdapters = new Pair<>(adapters.mAdapter, adapters.mThumbnailAdapter); } else if (isChanging) { final float durationScale = mWmService.getTransitionAnimationScaleLocked(); -- cgit v1.2.3-59-g8ed1b