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

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

Merge "Pausing app surface to receive touch during predictive back animation." into main

parents 9eb5c757 d5909d00
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -811,6 +811,13 @@ class BackNavigationController {
        return mAnimationHandler.isTarget(wc, wc.isVisibleRequested() /* open */);
    }

    boolean shouldPauseTouch(WindowContainer wc) {
        // Once the close transition is ready, it means the onBackInvoked callback has invoked, and
        // app is ready to trigger next transition, no matter what it will be.
        return mAnimationHandler.mComposed && mWaitTransitionFinish == null
                && mAnimationHandler.isTarget(wc, wc.isVisibleRequested() /* open */);
    }

    /**
     * Cleanup animation, this can either happen when legacy transition ready, or when the Shell
     * transition finish.
+5 −0
Original line number Diff line number Diff line
@@ -2974,6 +2974,11 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
            return true;
        }

        // Do not allow back predictive animation target to receive touch, app can trigger an
        // unexpected transition so basically unable to polish it.
        if (mWmService.mAtmService.mBackNavigationController.shouldPauseTouch(mActivityRecord)) {
            return false;
        }
        return !mActivityRecord.getTask().getRootTask().shouldIgnoreInput()
                && mActivityRecord.isVisibleRequested();
    }