diff options
| author | 2021-08-26 11:32:04 +0800 | |
|---|---|---|
| committer | 2021-09-09 15:09:17 +0800 | |
| commit | c5024fc2b453b80db43cf56130f8e01150e343be (patch) | |
| tree | 75c12faf222d64f0444f6f61ee3eb9d7c379d4c4 /libs | |
| parent | 506fa0bebd0e9ee013eaa5b15868a2ea4a379493 (diff) | |
Not removing primary TaskFragment when clear task
Placeholder activity was finished while starting the
task root activity from launcher because the task
root activity was set as singleTask launch mode.
Meanwhile, the primary TaskFragment was also removed
because of the split-rule finishPrimaryWithSecondary.
Sending the information of whether the last activity
on the TaskFragment was finished due to launch other
activity to client. So that the organizer can decide
whether the primary TaskFragment should removed.
Bug: 196179714
Test: relaunch singleTask activity with placeholder
Change-Id: I9a0369285adfbdef1edc5a7f2af944ec5b434566
Diffstat (limited to 'libs')
| -rw-r--r-- | libs/WindowManager/Jetpack/src/androidx/window/extensions/organizer/SplitController.java | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/libs/WindowManager/Jetpack/src/androidx/window/extensions/organizer/SplitController.java b/libs/WindowManager/Jetpack/src/androidx/window/extensions/organizer/SplitController.java index 05c6792a3fc7..756255017d9f 100644 --- a/libs/WindowManager/Jetpack/src/androidx/window/extensions/organizer/SplitController.java +++ b/libs/WindowManager/Jetpack/src/androidx/window/extensions/organizer/SplitController.java @@ -130,7 +130,11 @@ public class SplitController implements JetpackTaskFragmentOrganizer.TaskFragmen // Check if there are no running activities - consider the container empty if there are no // non-finishing activities left. if (!taskFragmentInfo.hasRunningActivity()) { - mPresenter.cleanupContainer(container, true /* shouldFinishDependent */); + // Do not finish the dependents if this TaskFragment was cleared due to launching + // activity in the Task. + final boolean shouldFinishDependent = + !taskFragmentInfo.isTaskClearedForReuse(); + mPresenter.cleanupContainer(container, shouldFinishDependent); updateCallbackIfNecessary(); } } |