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

Commit 81100970 authored by Wei Sheng Shih's avatar Wei Sheng Shih Committed by Android (Google) Code Review
Browse files

Merge "[PB] Do not reset launch behind if the prepare_back transition exists." into main

parents 67271f5b 10dfeb22
Loading
Loading
Loading
Loading
+13 −2
Original line number Original line Diff line number Diff line
@@ -761,7 +761,7 @@ class BackNavigationController {
            if (isMonitorForRemote()) {
            if (isMonitorForRemote()) {
                mObserver.sendResult(null /* result */);
                mObserver.sendResult(null /* result */);
            }
            }
            if (isMonitorAnimationOrTransition()) {
            if (isMonitorAnimationOrTransition() && canCancelAnimations()) {
                clearBackAnimations(true /* cancel */);
                clearBackAnimations(true /* cancel */);
            }
            }
            cancelPendingAnimation();
            cancelPendingAnimation();
@@ -2046,11 +2046,22 @@ class BackNavigationController {
        }
        }
    }
    }


    /** If the open transition is playing, wait for transition to clear the animation */
    private boolean canCancelAnimations() {
        if (!Flags.migratePredictiveBackTransition()) {
            return true;
        }
        return mAnimationHandler.mOpenAnimAdaptor == null
                || mAnimationHandler.mOpenAnimAdaptor.mPreparedOpenTransition == null;
    }

    void startAnimation() {
    void startAnimation() {
        if (!mBackAnimationInProgress) {
        if (!mBackAnimationInProgress) {
            // gesture is already finished, do not start animation
            // gesture is already finished, do not start animation
            if (mPendingAnimation != null) {
            if (mPendingAnimation != null) {
                if (canCancelAnimations()) {
                    clearBackAnimations(true /* cancel */);
                    clearBackAnimations(true /* cancel */);
                }
                mPendingAnimation = null;
                mPendingAnimation = null;
            }
            }
            return;
            return;