diff options
| author | Dianne Hackborn <hackbod@google.com> | 2009-06-19 11:37:35 -0700 |
|---|---|---|
| committer | Dianne Hackborn <hackbod@google.com> | 2009-06-19 11:37:35 -0700 |
| commit | d97c7adfc2d6e885826e40694a116cf3f9225025 (patch) | |
| tree | 67c989be345718a7b32898cc7e5042dbd70e31d7 /core/java/android/app | |
| parent | 63e7155c7d1d0c3f0027400aa09e9a45f648a80d (diff) | |
| download | frameworks_base-d97c7adfc2d6e885826e40694a116cf3f9225025.zip frameworks_base-d97c7adfc2d6e885826e40694a116cf3f9225025.tar.gz frameworks_base-d97c7adfc2d6e885826e40694a116cf3f9225025.tar.bz2 | |
Fix issue #1753079: running instrumentation in shared processes.
The check for allowing the start of an activity was broken, it was
comparing the process of that activity's application vs. the current
instrumentation target package name. Okay it was utterly insane.
Now this check is that the target activity will be running in the
same process as the instrumentation, which is really what we want.
Diffstat (limited to 'core/java/android/app')
| -rw-r--r-- | core/java/android/app/ActivityThread.java | 4 | ||||
| -rw-r--r-- | core/java/android/app/Instrumentation.java | 10 |
2 files changed, 9 insertions, 5 deletions
diff --git a/core/java/android/app/ActivityThread.java b/core/java/android/app/ActivityThread.java index 6873379..98bd45a 100644 --- a/core/java/android/app/ActivityThread.java +++ b/core/java/android/app/ActivityThread.java @@ -2088,6 +2088,10 @@ public final class ActivityThread { return mInitialApplication; } + public String getProcessName() { + return mBoundApplication.processName; + } + public ApplicationContext getSystemContext() { synchronized (this) { if (mSystemContext == null) { diff --git a/core/java/android/app/Instrumentation.java b/core/java/android/app/Instrumentation.java index f6a28b2..e31f4f8 100644 --- a/core/java/android/app/Instrumentation.java +++ b/core/java/android/app/Instrumentation.java @@ -446,13 +446,13 @@ public class Instrumentation { if (ai == null) { throw new RuntimeException("Unable to resolve activity for: " + intent); } - if (!ai.applicationInfo.processName.equals( - getTargetContext().getPackageName())) { + String myProc = mThread.getProcessName(); + if (!ai.processName.equals(myProc)) { // todo: if this intent is ambiguous, look here to see if // there is a single match that is in our package. - throw new RuntimeException("Intent resolved to different package " - + ai.applicationInfo.packageName + ": " - + intent); + throw new RuntimeException("Intent in process " + + myProc + " resolved to different process " + + ai.processName + ": " + intent); } intent.setComponent(new ComponentName( |
