summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--services/core/java/com/android/server/wm/RemoteAnimationController.java12
-rw-r--r--services/tests/wmtests/src/com/android/server/wm/RemoteAnimationControllerTest.java7
2 files changed, 12 insertions, 7 deletions
diff --git a/services/core/java/com/android/server/wm/RemoteAnimationController.java b/services/core/java/com/android/server/wm/RemoteAnimationController.java
index a1bc406c4550..7448e007f2c5 100644
--- a/services/core/java/com/android/server/wm/RemoteAnimationController.java
+++ b/services/core/java/com/android/server/wm/RemoteAnimationController.java
@@ -401,10 +401,14 @@ class RemoteAnimationController implements DeathRecipient {
// Restore z-layering, position and stack crop until client has a chance to modify it.
t.setLayer(animationLeash, mRecord.mAppWindowToken.getPrefixOrderIndex());
- t.setPosition(animationLeash, mPosition.x, mPosition.y);
- mTmpRect.set(mStackBounds);
- mTmpRect.offsetTo(0, 0);
- t.setWindowCrop(animationLeash, mTmpRect);
+ if (mRecord.mStartBounds != null) {
+ t.setPosition(animationLeash, mRecord.mStartBounds.left, mRecord.mStartBounds.top);
+ t.setWindowCrop(animationLeash, mRecord.mStartBounds.width(),
+ mRecord.mStartBounds.height());
+ } else {
+ t.setPosition(animationLeash, mPosition.x, mPosition.y);
+ t.setWindowCrop(animationLeash, mStackBounds.width(), mStackBounds.height());
+ }
mCapturedLeash = animationLeash;
mCapturedFinishCallback = finishCallback;
}
diff --git a/services/tests/wmtests/src/com/android/server/wm/RemoteAnimationControllerTest.java b/services/tests/wmtests/src/com/android/server/wm/RemoteAnimationControllerTest.java
index 74791e2ea97f..3e05dcc0f297 100644
--- a/services/tests/wmtests/src/com/android/server/wm/RemoteAnimationControllerTest.java
+++ b/services/tests/wmtests/src/com/android/server/wm/RemoteAnimationControllerTest.java
@@ -110,7 +110,7 @@ public class RemoteAnimationControllerTest extends WindowTestsBase {
assertEquals(false, app.isTranslucent);
verify(mMockTransaction).setLayer(mMockLeash, app.prefixOrderIndex);
verify(mMockTransaction).setPosition(mMockLeash, app.position.x, app.position.y);
- verify(mMockTransaction).setWindowCrop(mMockLeash, new Rect(0, 0, 100, 50));
+ verify(mMockTransaction).setWindowCrop(mMockLeash, 100, 50);
finishedCaptor.getValue().onAnimationFinished();
verify(mFinishedCallback).onAnimationFinished(eq(adapter));
@@ -251,8 +251,9 @@ public class RemoteAnimationControllerTest extends WindowTestsBase {
assertEquals(win.mWinAnimator.mLastClipRect, app.clipRect);
assertEquals(false, app.isTranslucent);
verify(mMockTransaction).setLayer(mMockLeash, app.prefixOrderIndex);
- verify(mMockTransaction).setPosition(mMockLeash, app.position.x, app.position.y);
- verify(mMockTransaction).setWindowCrop(mMockLeash, new Rect(0, 0, 200, 200));
+ verify(mMockTransaction).setPosition(
+ mMockLeash, app.startBounds.left, app.startBounds.top);
+ verify(mMockTransaction).setWindowCrop(mMockLeash, 200, 200);
verify(mMockTransaction).setPosition(mMockThumbnailLeash, 0, 0);
finishedCaptor.getValue().onAnimationFinished();