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

Commit 14b30bd4 authored by wilsonshih's avatar wilsonshih
Browse files

Skip transfer starting window from above if current activity has drawn.

If transferred, there is no signal to remove the starting window since
the activity is already drawn. The starting window will be remove with
above activity.

Bug: 283887866
Test: atest ActivityRecordTests SplashscreenTests
Change-Id: I0728db35ba8c476290d44462a040de77ab5986b7
parent 9087af02
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -4550,6 +4550,13 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
     * immediately finishes after, so we have to transfer T to M.
     */
    void transferStartingWindowFromHiddenAboveTokenIfNeeded() {
        final WindowState mainWin = findMainWindow(false);
        if (mainWin != null && mainWin.mWinAnimator.getShown()) {
            // This activity already has a visible window, so doesn't need to transfer the starting
            // window from above activity to here. The starting window will be removed with above
            // activity.
            return;
        }
        task.forAllActivities(fromActivity -> {
            if (fromActivity == this) return true;
            return !fromActivity.isVisibleRequested() && transferStartingWindow(fromActivity);