alsa_audio: route call voice to phone when on HDMI

Currently call voice is routed to HDMI rx/tx when HDMI cable is plugging.  So
call voice is muted.  MO/MT call voice routes to speaker/back-mic and
communication routes to HDMI rx/back-mic when HDMI cable is plugging.

Bug: 7218296
Change-Id: I53fc4d5b77ad6502a32c4e8d06e17141e2aa4be2
Signed-off-by: Iliyan Malchev <malchev@google.com>
diff --git a/alsa_sound/alsa_default.cpp b/alsa_sound/alsa_default.cpp
index c285e1e..eaa2343 100644
--- a/alsa_sound/alsa_default.cpp
+++ b/alsa_sound/alsa_default.cpp
@@ -399,8 +399,12 @@
                       AudioSystem::DEVICE_IN_BUILTIN_MIC);
 #endif
         } else if (devices & AudioSystem::DEVICE_OUT_AUX_DIGITAL) {
-            devices = devices | (AudioSystem::DEVICE_OUT_AUX_DIGITAL |
-                      AudioSystem::DEVICE_IN_AUX_DIGITAL);
+            if (mode == AudioSystem::MODE_IN_CALL)
+                devices = devices | (AudioSystem::DEVICE_IN_BACK_MIC |
+                           AudioSystem::DEVICE_OUT_SPEAKER);
+            else
+                devices = devices | (AudioSystem::DEVICE_OUT_AUX_DIGITAL |
+                          AudioSystem::DEVICE_IN_BACK_MIC);
 #ifdef QCOM_PROXY_DEVICE_ENABLED
         } else if ((devices & AudioSystem::DEVICE_OUT_PROXY) ||
                   (devices & AudioSystem::DEVICE_IN_PROXY)) {