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

Commit cdefbdc4 authored by wilsonshih's avatar wilsonshih
Browse files

[PB] Ensure BAC receive animation leashes before transition.

Fix the regression from ag/28959956.
The onAnimationStart signal is driven by WindowAnimator#animate, so it
could be slower than surface placement because it's following the
frame rate.

Flag: com.android.window.flags.migrate_predictive_back_transition
Bug: 361726487
Test: start activity then trigger back before open transition finish,
verify Shell side will receive animation leashes before transition.

Change-Id: Iea2f4bff7e3bbfb3fc5bb05b46e8b77441e750e7
parent a4851c83
Loading
Loading
Loading
Loading
+9 −4
Original line number Diff line number Diff line
@@ -574,12 +574,17 @@ class BackNavigationController {

    private void scheduleAnimation(@NonNull AnimationHandler.ScheduleAnimationBuilder builder) {
        mPendingAnimation = builder.build();
        if (mAnimationHandler.mOpenAnimAdaptor != null
                && mAnimationHandler.mOpenAnimAdaptor.mPreparedOpenTransition != null) {
            startAnimation();
        } else {
            mWindowManagerService.mWindowPlacerLocked.requestTraversal();
            if (mShowWallpaper) {
                mWindowManagerService.getDefaultDisplayContentLocked().mWallpaperController
                        .adjustWallpaperWindows();
            }
        }
    }

    private boolean isWaitBackTransition() {
        // Ignore mWaitTransition while flag is enabled.