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

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/20513753

Change-Id: I0c6db0a2d1c35d66dbaac3b099576a4adbfc12a8
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Louis Chang
2022-11-23 17:53:27 +00:00
committed by Automerger Merge Worker

View File

@@ -5150,7 +5150,16 @@ class Task extends TaskFragment {
final Task task = taskTop.getTask();
// 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)) {
final ActivityRecord newTop = task.getTopNonFinishingActivity();