[RESTRICT AUTOMERGE] Allow activity to be reparent while allowTaskReparenting is applied am: 7da08c6bd3

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

Change-Id: Ib96e68b166f745d709300479aab5cc5af0da6722
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Jeff Chang
2022-09-26 02:12:35 +00:00
committed by Automerger Merge Worker

View File

@@ -148,15 +148,16 @@ class ResetTargetTaskHelper {
return false;
} else {
mResultActivities.add(r);
if (r.resultTo != null) {
// If this activity is sending a reply to a previous activity, we can't do
// anything with it now until we reach the start of the reply chain.
// NOTE: that we are assuming the result is always to the previous activity,
// which is almost always the case but we really shouldn't count on.
mResultActivities.add(r);
return false;
} else if (mTargetTaskFound && allowTaskReparenting && mTargetTask.affinity != null
&& mTargetTask.affinity.equals(r.taskAffinity)) {
mResultActivities.add(r);
// This activity has an affinity for our task. Either remove it if we are
// clearing or move it over to our task. Note that we currently punt on the case
// where we are resetting a task that is not at the top but who has activities