am 9204644d: Merge "Fix a race condition in NativeDaemonConnector"

* commit '9204644d9e8fc2a3d05ff386b14b349f7a117694':
  Fix a race condition in NativeDaemonConnector
diff --git a/services/java/com/android/server/NativeDaemonConnector.java b/services/java/com/android/server/NativeDaemonConnector.java
index cf87a9d..88d94c2 100644
--- a/services/java/com/android/server/NativeDaemonConnector.java
+++ b/services/java/com/android/server/NativeDaemonConnector.java
@@ -97,11 +97,12 @@
                     LocalSocketAddress.Namespace.RESERVED);
 
             socket.connect(address);
-            mCallbacks.onDaemonConnected();
 
             InputStream inputStream = socket.getInputStream();
             mOutputStream = socket.getOutputStream();
 
+            mCallbacks.onDaemonConnected();
+
             byte[] buffer = new byte[BUFFER_SIZE];
             int start = 0;