summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSvet Ganov <svetoslavganov@google.com>2015-08-30 10:44:39 -0700
committerThe Android Automerger <android-build@google.com>2015-08-31 13:53:13 -0700
commitdbafadb3e564e563cde747ce3ebc0c6c57bbf243 (patch)
tree8241df659e4908f3352ac32c508e91c5640e463a
parent30396784df3743e41588204f6406f541be800bcf (diff)
downloadbase-dbafadb3e564e563cde747ce3ebc0c6c57bbf243.tar.gz
Fix a NPE when shutting down instrumentation
bug:23657953 Change-Id: I7187c3d911de24abe20a2c462a10352dd741efed
-rw-r--r--services/core/java/com/android/server/am/ActivityManagerService.java6
1 files changed, 4 insertions, 2 deletions
diff --git a/services/core/java/com/android/server/am/ActivityManagerService.java b/services/core/java/com/android/server/am/ActivityManagerService.java
index 1b0e6a276b99..191bf99e1b01 100644
--- a/services/core/java/com/android/server/am/ActivityManagerService.java
+++ b/services/core/java/com/android/server/am/ActivityManagerService.java
@@ -17152,8 +17152,10 @@ public final class ActivityManagerService extends ActivityManagerNative
}
// Can't call out of the system process with a lock held, so post a message.
- mHandler.obtainMessage(SHUTDOWN_UI_AUTOMATION_CONNECTION_MSG,
- app.instrumentationUiAutomationConnection).sendToTarget();
+ if (app.instrumentationUiAutomationConnection != null) {
+ mHandler.obtainMessage(SHUTDOWN_UI_AUTOMATION_CONNECTION_MSG,
+ app.instrumentationUiAutomationConnection).sendToTarget();
+ }
app.instrumentationWatcher = null;
app.instrumentationUiAutomationConnection = null;