summaryrefslogtreecommitdiffstats
path: root/services/java
diff options
context:
space:
mode:
authorDianne Hackborn <hackbod@google.com>2014-03-12 11:10:08 -0700
committerDianne Hackborn <hackbod@google.com>2014-03-12 11:16:29 -0700
commit3026d0bf0a4d89788cdc29573dcecb2bd72b263c (patch)
tree0169cf1c12c86970780946b0d557a7a6da0c385f /services/java
parent7f2c9e9420252a493b7399639f794c8a963444e5 (diff)
downloadframeworks_base-3026d0bf0a4d89788cdc29573dcecb2bd72b263c.zip
frameworks_base-3026d0bf0a4d89788cdc29573dcecb2bd72b263c.tar.gz
frameworks_base-3026d0bf0a4d89788cdc29573dcecb2bd72b263c.tar.bz2
Fix issue #11965706: Calls using IntentChooser are now Broken in 4.3 and 4.4
The activity manager needs to set launchedFromPackage to be that of the previous package in the case where flow has been redirected through an intermediate activity. Change-Id: I678fc2e7d984991ac715251a784ba7d7ccbf9fca
Diffstat (limited to 'services/java')
-rw-r--r--services/java/com/android/server/am/ActivityStackSupervisor.java13
1 files changed, 13 insertions, 0 deletions
diff --git a/services/java/com/android/server/am/ActivityStackSupervisor.java b/services/java/com/android/server/am/ActivityStackSupervisor.java
index 483b4a0..62e1340 100644
--- a/services/java/com/android/server/am/ActivityStackSupervisor.java
+++ b/services/java/com/android/server/am/ActivityStackSupervisor.java
@@ -1134,6 +1134,19 @@ public final class ActivityStackSupervisor {
resultRecord.removeResultsLocked(
sourceRecord, resultWho, requestCode);
}
+ if (sourceRecord.launchedFromUid == callingUid) {
+ // The new activity is being launched from the same uid as the previous
+ // activity in the flow, and asking to forward its result back to the
+ // previous. In this case the activity is serving as a trampoline between
+ // the two, so we also want to update its launchedFromPackage to be the
+ // same as the previous activity. Note that this is safe, since we know
+ // these two packages come from the same uid; the caller could just as
+ // well have supplied that same package name itself. This specifially
+ // deals with the case of an intent picker/chooser being launched in the app
+ // flow to redirect to an activity picked by the user, where we want the final
+ // activity to consider it to have been launched by the previous app activity.
+ callingPackage = sourceRecord.launchedFromPackage;
+ }
}
if (err == ActivityManager.START_SUCCESS && intent.getComponent() == null) {