Do not update calling pid/uid if the task cannot be relinquished
The calling pid/uid was updated by the new task root activity while the original task root activity finished. Since the updated uid doesn't have the Uri permission to restart the task, so user cannot launch the task from Recents. Bug: 156335070 Test: atest RecentTasksTest, start tasks from Recents Change-Id: Idc7d9ba03b0eea4e2ba979ab65a79b0f1e5b272a
This commit is contained in:
@@ -1261,10 +1261,13 @@ class Task extends WindowContainer<WindowContainer> {
|
|||||||
* @param info The activity info which could be different from {@code r.info} if set.
|
* @param info The activity info which could be different from {@code r.info} if set.
|
||||||
*/
|
*/
|
||||||
void setIntent(ActivityRecord r, @Nullable Intent intent, @Nullable ActivityInfo info) {
|
void setIntent(ActivityRecord r, @Nullable Intent intent, @Nullable ActivityInfo info) {
|
||||||
mCallingUid = r.launchedFromUid;
|
if (this.intent == null || !mNeverRelinquishIdentity) {
|
||||||
mCallingPackage = r.launchedFromPackage;
|
mCallingUid = r.launchedFromUid;
|
||||||
mCallingFeatureId = r.launchedFromFeatureId;
|
mCallingPackage = r.launchedFromPackage;
|
||||||
setIntent(intent != null ? intent : r.intent, info != null ? info : r.info);
|
mCallingFeatureId = r.launchedFromFeatureId;
|
||||||
|
setIntent(intent != null ? intent : r.intent, info != null ? info : r.info);
|
||||||
|
return;
|
||||||
|
}
|
||||||
setLockTaskAuth(r);
|
setLockTaskAuth(r);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1272,13 +1275,7 @@ class Task extends WindowContainer<WindowContainer> {
|
|||||||
private void setIntent(Intent _intent, ActivityInfo info) {
|
private void setIntent(Intent _intent, ActivityInfo info) {
|
||||||
if (!isLeafTask()) return;
|
if (!isLeafTask()) return;
|
||||||
|
|
||||||
if (intent == null) {
|
mNeverRelinquishIdentity = (info.flags & FLAG_RELINQUISH_TASK_IDENTITY) == 0;
|
||||||
mNeverRelinquishIdentity =
|
|
||||||
(info.flags & FLAG_RELINQUISH_TASK_IDENTITY) == 0;
|
|
||||||
} else if (mNeverRelinquishIdentity) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
affinity = info.taskAffinity;
|
affinity = info.taskAffinity;
|
||||||
if (intent == null) {
|
if (intent == null) {
|
||||||
// If this task already has an intent associated with it, don't set the root
|
// If this task already has an intent associated with it, don't set the root
|
||||||
|
|||||||
Reference in New Issue
Block a user