summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--core/java/android/app/Instrumentation.java7
1 files changed, 6 insertions, 1 deletions
diff --git a/core/java/android/app/Instrumentation.java b/core/java/android/app/Instrumentation.java
index d42fb4cbd512..c7618fe62c87 100644
--- a/core/java/android/app/Instrumentation.java
+++ b/core/java/android/app/Instrumentation.java
@@ -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());