Simplify the association of shared starting window
The issue case is launching an existing embedded activity with clear-task and then a new activity is started in a new task fragment. E.g. resume left panel -> finish right panel -> create right panel. And the transition starts until the right panel is drawn instead of the drawn starting window. That would feel a noticeable delay. This is mainly for showing starting window on a task with embedded activities, but also generalizes the common cases. 1. Move mSharedStartingData from ActivityRecord to Task. So if there is a new embedded activity launched in the task, it doesn't need to take care whether/when to assign the field. And no need to traverse all embedded activities in the task to make sure the shared starting data is up to date. 2. Move startingDisplayed from ActivityRecord to StartingData. The state of flag startingDisplayed is covered by the lifetime of StartingData. So it no longer needs to reset the flag. This also provides the ability to know whether the starting window is drawn or not without based on an activity or window. With above changes, any activity without owned starting window can know if the shared starting window is ready to execute transition. Also use a non-empty reference activity in createRemoteAnimationTarget, so the OPENING transition animation won't be skipped (the right panel is the top non-finishing activity but it hasn't a child window yet). Bug: 255688302 Test: atest ActivityRecordTests#testStartingWindowInTaskFragment Change-Id: I7adeed8801ea3a837afa3d46f1975cf6c5b3f99a
Loading
Please register or sign in to comment