Prevent new pip task from being added to recents
When swiping an auto-pip task with multiple activities,
the path to recents is from
r.reparent(rootTask...
> ActivityRecord#onParentChanged
> TaskFragment#setResumedActivity
> ActivitTaskSupervisor$#updateTopResumedActivityIfNeeded
> ATMS#setLastResumedActivityUncheckLocked
> RecentTasks#add
Because the current implementation preserve fullscreen mode of
the activity until the transition finishes, the activity is
focusable temporarily.
By making the pip task non-focusable only for reparent,
updateTopResumedActivityIfNeeded won't detect a focus change
and it will early return without changing states.
Though the toggle of focusable might not be needed if
isPip2ExperimentEnabled is turned on (because the activity will be
pinned mode immediately), it won't affect the result so it should
be safe as a general logic.
Fix: 309120043
Test: RootWindowContainerTests#testMultipleActivitiesTaskEnterPip
Change-Id: Ia5c00ea3b62271cc4eb552e99b64eb9000fb4394
Loading
Please register or sign in to comment