Moving all hierarchy chain to top when adjust focusable task.
Find a issue that when a background app crashed, the top focus
task would also changed because of AMS trigger resumeTopActivities.
However there should be nothing changed.
For some tasks like home or split screen, because they can be more
than one layer of task-to-container structure, so when adjusting
focus task, we should move the whole chain to the top of it's
container.
Also update preferred top focusable stack in
TaskDisplayArea#positionChildAt so the API can be more identical.
Fixes: 157393169
Test: atest ActivityRecordTests
Test: atest ActivityLifecycleTopResumedStateTests
Test: atest MultiDisplayPolicyTests
Change-Id: Ibf86f375ac91a50a013cfa7a7ea19e571a0a0d61
4 files changed