diff options
| -rw-r--r-- | services/core/java/com/android/server/wm/RecentsAnimationController.java | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/services/core/java/com/android/server/wm/RecentsAnimationController.java b/services/core/java/com/android/server/wm/RecentsAnimationController.java index 5da668c8c361..d3b0e63e7f61 100644 --- a/services/core/java/com/android/server/wm/RecentsAnimationController.java +++ b/services/core/java/com/android/server/wm/RecentsAnimationController.java @@ -763,7 +763,7 @@ public class RecentsAnimationController implements DeathRecipient { taskAdapter.mTask.dontAnimateDimExit(); } removeAnimation(taskAdapter); - taskAdapter.maybeApplyFinishBounds(); + taskAdapter.onCleanup(); } for (int i = mPendingWallpaperAnimations.size() - 1; i >= 0; i--) { @@ -987,14 +987,19 @@ public class RecentsAnimationController implements DeathRecipient { return mTarget; } - void maybeApplyFinishBounds() { + void onCleanup() { if (!mFinishBounds.isEmpty()) { + // Apply any pending bounds changes final SurfaceControl taskSurface = mTask.getSurfaceControl(); mTask.getPendingTransaction() .setPosition(taskSurface, mFinishBounds.left, mFinishBounds.top) .setWindowCrop(taskSurface, mFinishBounds.width(), mFinishBounds.height()) .apply(); mFinishBounds.setEmpty(); + } else { + // Apply the task's pending transaction in case it is detached and its transaction + // is not reachable. + mTask.getPendingTransaction().apply(); } } |