[RESTRICT AUTOMERGE]Prevent set intent on non-leaf tasks am: c5aaf99df5

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

Change-Id: I2eb959c19e5c079c8a4d76501ec5f33d0f754bd2
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Jeff Chang
2022-06-06 15:14:34 +00:00
committed by Automerger Merge Worker

View File

@@ -961,27 +961,20 @@ class Task extends WindowContainer<WindowContainer> {
mCallingPackage = r.launchedFromPackage;
mCallingFeatureId = r.launchedFromFeatureId;
setIntent(intent != null ? intent : r.intent, info != null ? info : r.info);
final WindowContainer parent = getParent();
if (parent != null) {
final Task t = parent.asTask();
if (t != null) {
t.setIntent(r);
}
}
}
setLockTaskAuth(r);
}
/** Sets the original intent, _without_ updating the calling uid or package. */
private void setIntent(Intent _intent, ActivityInfo info) {
final boolean isLeaf = isLeafTask();
if (!isLeafTask()) return;
if (intent == null) {
mNeverRelinquishIdentity = (info.flags & FLAG_RELINQUISH_TASK_IDENTITY) == 0;
} else if (mNeverRelinquishIdentity && isLeaf) {
} else if (mNeverRelinquishIdentity) {
return;
}
affinity = isLeaf ? info.taskAffinity : null;
affinity = info.taskAffinity;
if (intent == null) {
// If this task already has an intent associated with it, don't set the root
// affinity -- we don't want it changing after initially set, but the initially