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

Commit 84837512 authored by wilsonshih's avatar wilsonshih
Browse files

Ignore exit animation when view is detached from window.

After first launched activity start remove starting window, there start
a second activity with a new task, so there will trigger a open/close
task transition while playing starting window exit animation, but since
the first launched activity is going to destory, there will goes to
clear all window for that activity.
For client side we can ignore the animation after it was detached from
window.

Bug: 190040281
Test: manual
Change-Id: Idd939feb72163d585e14db480b1e374e41597928
parent 5c86c0c1
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();
        }