Fix multi-activity pip flickers
The flicker on enter is a simple fix, the original pip task wasn't collected so it's surface hide wasn't part of the sync transaction. Just collect it to solve that. For disappearing in overview, the problem is more subtle: With shell-transitions, pip-entry happens at the end of the transient-launch transition. This means the pipping activity is starting off behind the home task. With multi-activity, a new task is created to host the pip, but it is placed on TOP, so when we reparent the pip activity into it, because it is going from visibleRequested=false to visReq=true, it triggers focus logic with in-turn triggers RecentTasks logic. Because it is a temporary task, RecentTasks gets confused and marks the pip's original task as hidden. This then triggers removal on idle which in-turn removes the pip activity since it's really part of the original task. To fix this, we set the windowing-mode of the new (temporary) task to PINNED *before* reparenting the activity into it. That way it doesn't try to grab focus. Also, to make things clearer, this re-arranges some things: multi-activity pip-task doesn't have fragments, so moved the fragment code into the singleActivity case so its more obvious that this is the case. Did the same thing with "reparent to activity TDA" because the new task is created there already. Also made the temporary task match the original task's override windowing mode (instead of UNDEFINED), otherwise it can create flickers when pipping from a task in a different mode from the display. Bug: 269910373 Test: open multi-activity pip app, then swipe to home. Change-Id: I9e1b36b47e7de331db2fcea3d1b1b6cfd2d34a26
Loading
Please register or sign in to comment