Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d22c7cf1 authored by Chris Li's avatar Chris Li Committed by Automerger Merge Worker
Browse files

Merge "Block animation transfer after surface animation finishes." am:...

Merge "Block animation transfer after surface animation finishes." am: 4e54b2f3 am: 8057c823 am: b91693b1

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1948189

Change-Id: I917c4c8e5fe8773e694a6e36aa6ec6b36fb85fd9
parents 39173ced b91693b1
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -88,6 +88,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
@@ -137,6 +139,7 @@ class SurfaceAnimator {
                        || anim.shouldDeferAnimationFinish(resetAndInvokeFinish))) {
                    resetAndInvokeFinish.run();
                }
                mAnimationFinished = true;
            }
        };
    }
@@ -302,6 +305,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();
@@ -392,6 +398,7 @@ class SurfaceAnimator {
        SurfaceControl leash = mLeash;
        mLeash = null;
        final boolean scheduleAnim = removeLeash(t, mAnimatable, leash, destroyLeash);
        mAnimationFinished = false;
        if (scheduleAnim) {
            mService.scheduleAnimationLocked();
        }