IMS-VT: Honour audio routing preferance for dialing call

Whenever there is a change in audio routing for dialing call,
honour the new audio routing preferance

Change-Id: I506ff38203a8b5e05a112dab9ed5b798220020a0
CRs-Fixed: 1012524
diff --git a/src/com/android/server/telecom/CallsManager.java b/src/com/android/server/telecom/CallsManager.java
index c7d548c..9b90196 100644
--- a/src/com/android/server/telecom/CallsManager.java
+++ b/src/com/android/server/telecom/CallsManager.java
@@ -1410,6 +1410,13 @@
       * speaker phone.
       */
     void setAudioRoute(int route) {
+        Call call = getDialingCall();
+        if (call != null && call.getStartWithSpeakerphoneOn()) {
+            /* There is a change in audio routing preferance for the call.
+             * So, honour the new audio routing preferance.
+             */
+            call.setStartWithSpeakerphoneOn(false);
+        }
         mCallAudioManager.setAudioRoute(route);
     }