Sending initial audio mode when service connects.

Change also orders the setCallCommandService() above the updates.

bug:10426581
Change-Id: I544a7e3bd14274699350bf0393b502ee8e213a30
diff --git a/src/com/android/phone/CallHandlerServiceProxy.java b/src/com/android/phone/CallHandlerServiceProxy.java
index 3f38615..8a8e99d 100644
--- a/src/com/android/phone/CallHandlerServiceProxy.java
+++ b/src/com/android/phone/CallHandlerServiceProxy.java
@@ -286,14 +286,26 @@
         synchronized (mServiceAndQueueLock) {
             mCallHandlerServiceGuarded = callHandlerService;
 
+            // Before we send any updates, we need to set up the initial service calls.
+            makeInitialServiceCalls();
+
             // TODO(klp): combine queues into a single ordered queue.
             processIncomingCallQueue();
             processUpdateCallQueue();
             processDisconnectQueue();
         }
+    }
 
+    /**
+     * Makes initial service calls to set up callcommandservice and audio modes.
+     */
+    private void makeInitialServiceCalls() {
         try {
             mCallHandlerServiceGuarded.setCallCommandService(mCallCommandService);
+
+            onSupportedAudioModeChange(mAudioRouter.getSupportedAudioModes());
+            final int mode = mAudioRouter.getAudioMode();
+            onAudioModeChange(mode, mode);
         } catch (RemoteException e) {
             Log.e(TAG, "Remote exception calling CallHandlerService::setCallCommandService", e);
         }