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

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

Merge "[PB] Fix windowless window could be remove too early" into main

parents 38435491 64080861
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, () -> {