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

Commit ef25cfa0 authored by Riddle Hsu's avatar Riddle Hsu
Browse files

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
parent cf01f294
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment