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

Commit 6d868bce authored by Riddle Hsu's avatar Riddle Hsu Committed by Android (Google) Code Review
Browse files

Merge "Reduce showing starting window from a task trampoline" into main

parents 28149456 e76794ad
Loading
Loading
Loading
Loading
+13 −0
Original line number Diff line number Diff line
@@ -2538,6 +2538,19 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
                }
            }
            if (!activityAllDrawn && !isActivityHome) {
                // Only check the special case of a fragment host task because the starting window
                // may not be visible if the client organizer delays the transition ready.
                if (task.mTaskFragmentHostProcessName != null) {
                    // It may be launched from a task trampoline that already has a starting window.
                    // Return NONE because 2 consecutive splashes may not look smooth in visual.
                    final Task prevTask = task.getParent().getTaskBelow(task);
                    if (prevTask != null) {
                        final ActivityRecord prevTaskTop = prevTask.getTopMostActivity();
                        if (prevTaskTop != null && prevTaskTop.hasStartingWindow()) {
                            return STARTING_WINDOW_TYPE_NONE;
                        }
                    }
                }
                return STARTING_WINDOW_TYPE_SPLASH_SCREEN;
            }
        }