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

Commit 64080861 authored by wilsonshih's avatar wilsonshih
Browse files

[PB] Fix windowless window could be remove too early

After migrate predictive back to shell transition, the opening
target only become visible after transition ready, so the remove
signal should be trigger when transition ready.

Flag: com.android.window.flags.migrate_predictive_back_transition
Bug: 361726487
Test: follow issue description, monitor the windowless window won't
get remove before app window show

Change-Id: I6c586e32ad4663cbc2585cafb26d775380709856
parent 8ad726d8
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -1392,6 +1392,7 @@ public class BackAnimationController implements RemoteCallable<BackAnimationCont
            }
            // Handle the commit transition if this handler is running the open transition.
            finishCallback.onTransitionFinished(null);
            t.apply();
            if (mCloseTransitionRequested) {
                if (mApps == null || mApps.length == 0) {
                    if (mQueuedTransition == null) {
+13 −1
Original line number Diff line number Diff line
@@ -1203,7 +1203,7 @@ class BackNavigationController {
        }

        void markWindowHasDrawn(ActivityRecord activity) {
            if (!mComposed || mWaitTransition || mOpenAnimAdaptor.mPreparedOpenTransition == null
            if (!mComposed || mWaitTransition
                    || mOpenAnimAdaptor.mRequestedStartingSurfaceId == INVALID_TASK_ID) {
                return;
            }
@@ -1215,6 +1215,10 @@ class BackNavigationController {
                }
                allWindowDrawn &= next.mAppWindowDrawn;
            }
            // Do not remove until transition ready.
            if (!activity.isVisible()) {
                return;
            }
            if (allWindowDrawn) {
                mOpenAnimAdaptor.cleanUpWindowlessSurface(true);
            }
@@ -1289,6 +1293,14 @@ class BackNavigationController {
            if (mOpenAnimAdaptor.mRequestedStartingSurfaceId == INVALID_TASK_ID) {
                return;
            }
            boolean allWindowDrawn = true;
            for (int i = mOpenAnimAdaptor.mAdaptors.length - 1; i >= 0; --i) {
                final BackWindowAnimationAdaptor next = mOpenAnimAdaptor.mAdaptors[i];
                allWindowDrawn &= next.mAppWindowDrawn;
            }
            if (!allWindowDrawn) {
                return;
            }
            final SurfaceControl startingSurface = mOpenAnimAdaptor.mStartingSurface;
            if (startingSurface != null && startingSurface.isValid()) {
                startTransaction.addTransactionCommittedListener(Runnable::run, () -> {