Ensuring that we update the calling uid/package when updating a task's original intent. (Bug 16676636)
Change-Id: I5d75a912e86e83f05717cb19e9b6edb02eb053e6
This commit is contained in:
@@ -1714,7 +1714,7 @@ public final class ActivityStackSupervisor implements DisplayListener {
|
||||
// the activity based on affinity... now that we
|
||||
// are actually launching it, we can assign the
|
||||
// base intent.
|
||||
intentActivity.task.setIntent(intent, r.info);
|
||||
intentActivity.task.setIntent(r);
|
||||
}
|
||||
// If the target task is not in the front, then we need
|
||||
// to bring it to the front... except... well, with
|
||||
@@ -1771,7 +1771,7 @@ public final class ActivityStackSupervisor implements DisplayListener {
|
||||
// not be too hard...
|
||||
reuseTask = intentActivity.task;
|
||||
reuseTask.performClearTaskLocked();
|
||||
reuseTask.setIntent(r.intent, r.info);
|
||||
reuseTask.setIntent(r);
|
||||
} else if ((launchFlags&Intent.FLAG_ACTIVITY_CLEAR_TOP) != 0
|
||||
|| launchSingleInstance || launchSingleTask) {
|
||||
// In this situation we want to remove all activities
|
||||
@@ -1786,7 +1786,7 @@ public final class ActivityStackSupervisor implements DisplayListener {
|
||||
// intents for the top activity, so make sure
|
||||
// the task now has the identity of the new
|
||||
// intent.
|
||||
top.task.setIntent(r.intent, r.info);
|
||||
top.task.setIntent(r);
|
||||
}
|
||||
ActivityStack.logStartActivity(EventLogTags.AM_NEW_INTENT,
|
||||
r, top.task);
|
||||
@@ -1815,7 +1815,7 @@ public final class ActivityStackSupervisor implements DisplayListener {
|
||||
ActivityStack.logStartActivity(EventLogTags.AM_NEW_INTENT, r,
|
||||
intentActivity.task);
|
||||
if (intentActivity.frontOfTask) {
|
||||
intentActivity.task.setIntent(r.intent, r.info);
|
||||
intentActivity.task.setIntent(r);
|
||||
}
|
||||
intentActivity.deliverNewIntentLocked(callingUid, r.intent);
|
||||
} else if (!r.intent.filterEquals(intentActivity.task.intent)) {
|
||||
@@ -1841,7 +1841,7 @@ public final class ActivityStackSupervisor implements DisplayListener {
|
||||
// at the bottom of its stack, but that's a little hard
|
||||
// to do with the current organization of the code so
|
||||
// for now we'll just drop it.
|
||||
intentActivity.task.setIntent(r.intent, r.info);
|
||||
intentActivity.task.setIntent(r);
|
||||
}
|
||||
if (!addingToTask && reuseTask == null) {
|
||||
// We didn't do anything... but it was needed (a.k.a., client
|
||||
|
||||
@@ -220,7 +220,15 @@ final class TaskRecord {
|
||||
return System.currentTimeMillis() - lastActiveTime;
|
||||
}
|
||||
|
||||
void setIntent(Intent _intent, ActivityInfo info) {
|
||||
/** Sets the original intent, and the calling uid and package. */
|
||||
void setIntent(ActivityRecord r) {
|
||||
setIntent(r.intent, r.info);
|
||||
mCallingUid = r.launchedFromUid;
|
||||
mCallingPackage = r.launchedFromPackage;
|
||||
}
|
||||
|
||||
/** Sets the original intent, _without_ updating the calling uid or package. */
|
||||
private void setIntent(Intent _intent, ActivityInfo info) {
|
||||
if (intent == null) {
|
||||
mNeverRelinquishIdentity =
|
||||
(info.flags & ActivityInfo.FLAG_RELINQUISH_TASK_IDENTITY) == 0;
|
||||
@@ -723,7 +731,7 @@ final class TaskRecord {
|
||||
void updateEffectiveIntent() {
|
||||
final int effectiveRootIndex = findEffectiveRootIndex();
|
||||
final ActivityRecord r = mActivities.get(effectiveRootIndex);
|
||||
setIntent(r.intent, r.info);
|
||||
setIntent(r);
|
||||
}
|
||||
|
||||
void saveTaskDescription(ActivityManager.TaskDescription taskDescription,
|
||||
|
||||
Reference in New Issue
Block a user