Merge "Mark the task as reusable while clearing activities in the Task" into tm-qpr-dev

This commit is contained in:
Louis Chang
2022-11-23 04:22:18 +00:00
committed by Android (Google) Code Review

View File

@@ -5183,7 +5183,16 @@ class Task extends TaskFragment {
final Task task = taskTop.getTask(); final Task task = taskTop.getTask();
// If ActivityOptions are moved out and need to be aborted or moved to taskTop. // If ActivityOptions are moved out and need to be aborted or moved to taskTop.
final ActivityOptions topOptions = sResetTargetTaskHelper.process(task, forceReset); final ActivityOptions topOptions;
// Set the task to be reused, so the TaskFragment#mClearedTaskForReuse can be set if the
// embedded activities are finished while reset task.
mReuseTask = true;
try {
topOptions = sResetTargetTaskHelper.process(task, forceReset);
} finally {
mReuseTask = false;
}
if (mChildren.contains(task)) { if (mChildren.contains(task)) {
final ActivityRecord newTop = task.getTopNonFinishingActivity(); final ActivityRecord newTop = task.getTopNonFinishingActivity();