Merge "Make Instrumentation more robust to other inputs" into pi-dev am: 3071522227
am: d1a9320e98
Change-Id: Iada00b0e18f978f8fc85a74fa45ccd21cbeb20ef
This commit is contained in:
@@ -1210,11 +1210,16 @@ public class Instrumentation {
|
||||
Intent intent)
|
||||
throws InstantiationException, IllegalAccessException,
|
||||
ClassNotFoundException {
|
||||
String pkg = intent.getComponent().getPackageName();
|
||||
String pkg = intent != null && intent.getComponent() != null
|
||||
? intent.getComponent().getPackageName() : null;
|
||||
return getFactory(pkg).instantiateActivity(cl, className, intent);
|
||||
}
|
||||
|
||||
private AppComponentFactory getFactory(String pkg) {
|
||||
if (pkg == null) {
|
||||
Log.e(TAG, "No pkg specified, disabling AppComponentFactory");
|
||||
return AppComponentFactory.DEFAULT;
|
||||
}
|
||||
if (mThread == null) {
|
||||
Log.e(TAG, "Uninitialized ActivityThread, likely app-created Instrumentation,"
|
||||
+ " disabling AppComponentFactory", new Throwable());
|
||||
|
||||
Reference in New Issue
Block a user