Do not finish TaskFragment if a new activity is expected
If a TaskFragment only has one activity, and the activity finishes itself and then immediately launches a new activity, there is a race condition causing the newly launched activity to be in the TaskFragment but the TaskFragment gets finished. This is because finish happens first, causing the SplitController to receive a TaskFragment info with no running activities in it, and SplitController finishes the TaskFragment even if a new activity is being launched into the TaskFragment. This CL delays the TaskFragment cleanup so that the activity may appear in the TaskFragment and in this case we do not need to finish the TaskFragment. Bug: 390452023 Test: atest SplitControllerTest ActivityEmbeddingLaunchTests ActivityEmbeddingLifecycleTests ActivityEmbeddingPolicyTests Flag: com.android.window.flags.activity_embedding_delay_task_fragment_finish_for_activity_launch Change-Id: I8dff5d54a5a6cb623e944f7f7ed94d5cff9fbc44
Loading
Please register or sign in to comment