Ensuring that we update the calling uid/package when updating a task's original intent. (Bug 16676636)

Change-Id: I5d75a912e86e83f05717cb19e9b6edb02eb053e6
diff --git a/services/core/java/com/android/server/am/ActivityStackSupervisor.java b/services/core/java/com/android/server/am/ActivityStackSupervisor.java
index 4a99ef3..3d23cb7 100644
--- a/services/core/java/com/android/server/am/ActivityStackSupervisor.java
+++ b/services/core/java/com/android/server/am/ActivityStackSupervisor.java
@@ -1714,7 +1714,7 @@
                         // 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 @@
                         // 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 @@
                                 // 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 @@
                             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 @@
                         // 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