Streamline activity start flow
Refactor activity start logic by moving the similar operations
together and remove code duplications.
The reusable task is selected in earlier stage, so that some
permission and security check could be performed before manipulating
the task (reparenting or finishing activities).
Also fix two activity start cases that didn't work as expected.
Bug: 139449647
Bug: 139390610
Bug: 139333063
Test: atest WmTests CtsWindowManagerDeviceTestCases
Change-Id: Icbaaa29d79fd6cb13a1dff60d45289a6253d20f9
3 files changed