diff options
author | 2022-01-27 03:17:35 +0000 | |
---|---|---|
committer | 2022-01-27 03:17:35 +0000 | |
commit | 4e54b2f3f960e520b8be831f6a46d90c28bd802f (patch) | |
tree | a7416842985c400c31511cfb44f6289bbf6440bd | |
parent | 35ac7e34ce6c088457b87130221c52305a03bb3d (diff) | |
parent | 905e027925f1056d99a38a02071a08d205cbba9d (diff) |
Merge "Block animation transfer after surface animation finishes."
-rw-r--r-- | services/core/java/com/android/server/wm/SurfaceAnimator.java | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/services/core/java/com/android/server/wm/SurfaceAnimator.java b/services/core/java/com/android/server/wm/SurfaceAnimator.java index c7bf8ecfe949..94f0e24f88c9 100644 --- a/services/core/java/com/android/server/wm/SurfaceAnimator.java +++ b/services/core/java/com/android/server/wm/SurfaceAnimator.java @@ -85,6 +85,8 @@ class SurfaceAnimator { private boolean mAnimationStartDelayed; + private boolean mAnimationFinished; + /** * @param animatable The object to animate. * @param staticAnimationFinishedCallback Callback to invoke when an animation has finished @@ -134,6 +136,7 @@ class SurfaceAnimator { || anim.shouldDeferAnimationFinish(resetAndInvokeFinish))) { resetAndInvokeFinish.run(); } + mAnimationFinished = true; } }; } @@ -289,6 +292,9 @@ class SurfaceAnimator { Slog.w(TAG, "Unable to transfer animation, surface or parent is null"); cancelAnimation(); return; + } else if (from.mAnimationFinished) { + Slog.w(TAG, "Unable to transfer animation, because " + from + " animation is finished"); + return; } endDelayingAnimationStart(); final Transaction t = mAnimatable.getPendingTransaction(); @@ -367,6 +373,7 @@ class SurfaceAnimator { SurfaceControl leash = mLeash; mLeash = null; final boolean scheduleAnim = removeLeash(t, mAnimatable, leash, destroyLeash); + mAnimationFinished = false; if (scheduleAnim) { mService.scheduleAnimationLocked(); } |