OSDN Git Service

Initialize the animation leash with the current values
authorWinson Chung <winsonc@google.com>
Fri, 13 Apr 2018 00:14:50 +0000 (17:14 -0700)
committerWinson Chung <winsonc@google.com>
Fri, 13 Apr 2018 00:14:50 +0000 (17:14 -0700)
- We already do this with remote animations, need to do this with the
  recents animation to ensure that layers are set correctly by default.

Bug: 77981669
Test: Open app, open translucent activity, swipe up and ensure that they
      don't reorder during the transition

Change-Id: I492d12b871c602e348ea0623752787b8b0ac3f10

services/core/java/com/android/server/wm/RecentsAnimationController.java

index 1ee642a..6478632 100644 (file)
@@ -549,7 +549,12 @@ public class RecentsAnimationController implements DeathRecipient {
         @Override
         public void startAnimation(SurfaceControl animationLeash, Transaction t,
                 OnAnimationFinishedCallback finishCallback) {
+            // Restore z-layering, position and stack crop until client has a chance to modify it.
+            t.setLayer(animationLeash, mTask.getPrefixOrderIndex());
             t.setPosition(animationLeash, mPosition.x, mPosition.y);
+            mTmpRect.set(mBounds);
+            mTmpRect.offsetTo(0, 0);
+            t.setWindowCrop(animationLeash, mTmpRect);
             mCapturedLeash = animationLeash;
             mCapturedFinishCallback = finishCallback;
         }