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

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

Merge "Polish transfer starting window across more than two activities." into main

parents 8f12a1e3 cd3bf7ae
Loading
Loading
Loading
Loading
+21 −0
Original line number Diff line number Diff line
@@ -4613,6 +4613,17 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
            } else if (fromOrientation != requestedOrientation) {
                return false;
            }

            // If another activity above the activity which has starting window, allows to steal the
            // starting window if the above activity isn't drawn.
            if (task.getChildCount() >= 3
                    && fromActivity.mStartingData.mAssociatedTask == null) {
                final ActivityRecord aboveFrom = task.getActivityAbove(fromActivity);
                if (aboveFrom != null && aboveFrom != this && !aboveFrom.mReportedDrawn) {
                    return false;
                }
            }

            // In this case, the starting icon has already been displayed, so start
            // letting windows get shown immediately without any more transitions.
            if (fromActivity.mVisible) {
@@ -4636,6 +4647,16 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
                tStartingWindow.mToken = this;
                tStartingWindow.mActivityRecord = this;

                if (mStartingData.mRemoveAfterTransaction == AFTER_TRANSACTION_REMOVE_DIRECTLY) {
                    // The removal of starting window should wait for window drawn of current
                    // activity.
                    final WindowState mainWin = findMainWindow(false /* includeStartingApp */);
                    if (mainWin == null || !mainWin.isDrawn()) {
                        mStartingData.mRemoveAfterTransaction = AFTER_TRANSACTION_IDLE;
                        mStartingData.mPrepareRemoveAnimation = false;
                    }
                }

                ProtoLog.v(WM_DEBUG_ADD_REMOVE,
                        "Removing starting %s from %s", tStartingWindow, fromActivity);
                mTransitionController.collect(tStartingWindow);