Merge change 4785 into donut
* changes: Fix issue #1753079: running instrumentation in shared processes.
This commit is contained in:
@@ -2088,6 +2088,10 @@ public final class ActivityThread {
|
|||||||
return mInitialApplication;
|
return mInitialApplication;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getProcessName() {
|
||||||
|
return mBoundApplication.processName;
|
||||||
|
}
|
||||||
|
|
||||||
public ApplicationContext getSystemContext() {
|
public ApplicationContext getSystemContext() {
|
||||||
synchronized (this) {
|
synchronized (this) {
|
||||||
if (mSystemContext == null) {
|
if (mSystemContext == null) {
|
||||||
|
|||||||
@@ -446,13 +446,13 @@ public class Instrumentation {
|
|||||||
if (ai == null) {
|
if (ai == null) {
|
||||||
throw new RuntimeException("Unable to resolve activity for: " + intent);
|
throw new RuntimeException("Unable to resolve activity for: " + intent);
|
||||||
}
|
}
|
||||||
if (!ai.applicationInfo.processName.equals(
|
String myProc = mThread.getProcessName();
|
||||||
getTargetContext().getPackageName())) {
|
if (!ai.processName.equals(myProc)) {
|
||||||
// todo: if this intent is ambiguous, look here to see if
|
// todo: if this intent is ambiguous, look here to see if
|
||||||
// there is a single match that is in our package.
|
// there is a single match that is in our package.
|
||||||
throw new RuntimeException("Intent resolved to different package "
|
throw new RuntimeException("Intent in process "
|
||||||
+ ai.applicationInfo.packageName + ": "
|
+ myProc + " resolved to different process "
|
||||||
+ intent);
|
+ ai.processName + ": " + intent);
|
||||||
}
|
}
|
||||||
|
|
||||||
intent.setComponent(new ComponentName(
|
intent.setComponent(new ComponentName(
|
||||||
|
|||||||
Reference in New Issue
Block a user