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

Commit 881b6679 authored by Riddle Hsu's avatar Riddle Hsu
Browse files

Avoid setting stale surface visibility from back transition

Since migrate_predictive_back_transition is enabled, the surface
visibility will be updated with transition, so it no longer needs
to update manually.

Otherwise because the pending transaction applies on next frame
by WindowAnimator, there could be a race that the sync transaction of
transition sets to visible, but the pending transaction still holds
the hide operation of previous transition and then make the surfaces
invisible unexpectedly.

Bug: 384659191
Flag: EXEMPT bugfix
Test: Launch app from home and trigger back gesture right after the
      animation finishes. The wallpaper should be visible after
      returning to home.
Change-Id: I2dc05778aab74e9340c46aa2f65da2069d394be1
parent c05c4e0e
Loading
Loading
Loading
Loading
+1 −11
Original line number Diff line number Diff line
@@ -997,11 +997,9 @@ class BackNavigationController {
    /**
     * Handle the pending animation when the running transition finished, all the visibility change
     * has applied so ready to start pending predictive back animation.
     * @param targets The final animation targets derived in transition.
     * @param finishedTransition The finished transition target.
    */
    void onTransitionFinish(ArrayList<Transition.ChangeInfo> targets,
            @NonNull Transition finishedTransition) {
    void onTransitionFinish(@NonNull Transition finishedTransition) {
        if (isMonitoringPrepareTransition(finishedTransition)) {
            if (mAnimationHandler.mPrepareCloseTransition == null) {
                clearBackAnimations(true /* cancel */);
@@ -1049,14 +1047,6 @@ class BackNavigationController {
            return;
        }

        // Ensure the final animation targets which hidden by transition could be visible.
        for (int i = 0; i < targets.size(); i++) {
            final WindowContainer wc = targets.get(i).mContainer;
            if (wc.mSurfaceControl != null) {
                wc.prepareSurfaces();
            }
        }

        // The pending builder could be cleared due to prepareSurfaces
        // => updateNonSystemOverlayWindowsVisibilityIfNeeded
        // => setForceHideNonSystemOverlayWindowIfNeeded
+1 −1
Original line number Diff line number Diff line
@@ -1589,7 +1589,7 @@ class Transition implements BLASTSyncEngine.TransactionReadyListener {
        cleanUpInternal();

        // Handle back animation if it's already started.
        mController.mAtm.mBackNavigationController.onTransitionFinish(mTargets, this);
        mController.mAtm.mBackNavigationController.onTransitionFinish(this);
        mController.mFinishingTransition = null;
        mController.mSnapshotController.onTransitionFinish(mType, mTargets);
        // Resume snapshot persist thread after snapshot controller analysis this transition.