Fix ActivityEmbedding issues with REORDER_TO_FRONT
1. When the primary TaskFragment is finished with shouldFinishDependent
= false, it should still finish the placeholder TaskFragment.
Otherwise it may leave the placeholder there forever.
2. In case the app starts two activities one after another, if the first
Intent is not handled, but the second is, when the first activity
onCreate reach the organizer, it may be reparented to a new
TaskFragment that is on top of the second activity. We want to make
sure that the TaskFragment is created at the same position as the
reparent Activity.
Bug: 255628567
Test: manually verify with the test app in the bug.
Test: atest WMJetpackUnitTests:TaskFragmentContainerTest
Test: atest WmTests:TaskFragmentOrganizerControllerTest
Change-Id: Ie48d7e46786cabcf3a1ededa9275f0223e2f477f
8 files changed