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

Commit 3891f0cd authored by Wei Sheng Shih's avatar Wei Sheng Shih Committed by Automerger Merge Worker
Browse files

Merge "Ignore exit animation when view is detached from window." into sc-dev...

Merge "Ignore exit animation when view is detached from window." into sc-dev am: a1b3ce52 am: 9517b681

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

Change-Id: Ie48fb59811b2665514e1c723de4e6bce51015aa2
parents 3aac256c 9517b681
Loading
Loading
Loading
Loading
+19 −12
Original line number Diff line number Diff line
@@ -235,7 +235,8 @@ public class SplashScreenExitAnimation implements Animator.AnimatorListener {
        }

        void onAnimationProgress(float linearProgress) {
            if (mFirstWindowSurface == null || !mFirstWindowSurface.isValid()) {
            if (mFirstWindowSurface == null || !mFirstWindowSurface.isValid()
                    || !mSplashScreenView.isAttachedToWindow()) {
                return;
            }

@@ -267,6 +268,7 @@ public class SplashScreenExitAnimation implements Animator.AnimatorListener {
                return;
            }
            final SurfaceControl.Transaction tx = mTransactionPool.acquire();
            if (mSplashScreenView.isAttachedToWindow()) {
                tx.setFrameTimelineVsync(Choreographer.getSfInstance().getVsyncId());

                SyncRtSurfaceTransactionApplier.SurfaceParams
@@ -276,6 +278,10 @@ public class SplashScreenExitAnimation implements Animator.AnimatorListener {
                        .withMergeTransaction(tx)
                        .build();
                mApplier.scheduleApply(params);
            } else {
                tx.setWindowCrop(mFirstWindowSurface, null);
                tx.apply();
            }
            mTransactionPool.release(tx);

            Choreographer.getSfInstance().postCallback(CALLBACK_COMMIT,
@@ -287,13 +293,14 @@ public class SplashScreenExitAnimation implements Animator.AnimatorListener {
        if (DEBUG_EXIT_ANIMATION) {
            Slog.v(TAG, "vanish animation finished");
        }
        mSplashScreenView.post(() -> {

        if (mSplashScreenView.isAttachedToWindow()) {
            mSplashScreenView.setVisibility(GONE);
            if (mFinishCallback != null) {
                mFinishCallback.run();
                mFinishCallback = null;
            }
        });
        }
        if (mShiftUpAnimation != null) {
            mShiftUpAnimation.finish();
        }