hal: msm8974: select HFP devices based on hfp active session

Bug: 31922459
Change-Id: Iae2a7fb4dc984810b469e1e7e0b1d947e17f8db3
diff --git a/hal/msm8974/platform.c b/hal/msm8974/platform.c
index 023a9ef..d07105a 100644
--- a/hal/msm8974/platform.c
+++ b/hal/msm8974/platform.c
@@ -2058,7 +2058,8 @@
 
     ALOGV("%s: enter: out_device(%#x) in_device(%#x) channel_count (%d) channel_mask (0x%x)",
           __func__, out_device, in_device, channel_count, channel_mask);
-    if ((out_device != AUDIO_DEVICE_NONE) && voice_is_in_call(adev)) {
+    if ((out_device != AUDIO_DEVICE_NONE) && (voice_is_in_call(adev) ||
+        audio_extn_hfp_is_active(adev))) {
         if (adev->voice.tty_mode != TTY_MODE_OFF) {
             if (out_device & AUDIO_DEVICE_OUT_WIRED_HEADPHONE ||
                 out_device & AUDIO_DEVICE_OUT_WIRED_HEADSET ||