OSDN Git Service

Merge "Fix a NPE when shutting down instrumentation" into mnc-dev
authorSvetoslav Ganov <svetoslavganov@google.com>
Mon, 31 Aug 2015 17:16:23 +0000 (17:16 +0000)
committerAndroid (Google) Code Review <android-gerrit@google.com>
Mon, 31 Aug 2015 17:16:23 +0000 (17:16 +0000)
services/core/java/com/android/server/am/ActivityManagerService.java

index 1b0e6a2..191bf99 100644 (file)
@@ -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;