Merge "Postpone destroying leash until after cancel callback."

This commit is contained in:
TreeHugger Robot
2019-02-12 03:34:25 +00:00
committed by Android (Google) Code Review

View File

@@ -251,7 +251,7 @@ class SurfaceAnimator {
if (DEBUG_ANIM) Slog.i(TAG, "Cancelling animation restarting=" + restarting);
final SurfaceControl leash = mLeash;
final AnimationAdapter animation = mAnimation;
reset(t, forwardCancel);
reset(t, false);
if (animation != null) {
if (!mAnimationStartDelayed && forwardCancel) {
animation.onAnimationCancelled(leash);
@@ -260,6 +260,12 @@ class SurfaceAnimator {
mAnimationFinishedCallback.run();
}
}
if (forwardCancel && leash != null) {
t.remove(leash);
mService.scheduleAnimationLocked();
}
if (!restarting) {
mAnimationStartDelayed = false;
}