hal : Set the input device for VOIP calls using audio path
For Voip calls using audio path ,the input devices is not
getting selected when output device is changed.
Removed the source type check to select the input device
when there is an active input and output device switch.
Change-Id: Iab7a6fddb3dda045fab94cd72de8e658721d9237
CRs-fixed: 712950
diff --git a/hal/audio_hw.c b/hal/audio_hw.c
index 4e33dfb..ce26388 100644
--- a/hal/audio_hw.c
+++ b/hal/audio_hw.c
@@ -795,8 +795,7 @@
out_snd_device = platform_get_output_snd_device(adev->platform,
usecase->stream.out->devices);
if (usecase->stream.out == adev->primary_output &&
- adev->active_input &&
- adev->active_input->source == AUDIO_SOURCE_VOICE_COMMUNICATION) {
+ adev->active_input) {
select_devices(adev, adev->active_input->usecase);
}
}
@@ -805,8 +804,10 @@
out_snd_device = SND_DEVICE_NONE;
if (in_snd_device == SND_DEVICE_NONE) {
audio_devices_t out_device = AUDIO_DEVICE_NONE;
- if (adev->active_input->source == AUDIO_SOURCE_VOICE_COMMUNICATION &&
- adev->primary_output && !adev->primary_output->standby) {
+ if ((adev->active_input->source == AUDIO_SOURCE_VOICE_COMMUNICATION ||
+ (adev->mode == AUDIO_MODE_IN_COMMUNICATION &&
+ adev->active_input->source == AUDIO_SOURCE_MIC)) &&
+ adev->primary_output && !adev->primary_output->standby) {
out_device = adev->primary_output->devices;
} else if (usecase->id == USECASE_AUDIO_RECORD_AFE_PROXY) {
out_device = AUDIO_DEVICE_OUT_TELEPHONY_TX;
diff --git a/hal/msm8916/platform.c b/hal/msm8916/platform.c
index 09b98ec..b72f017 100644
--- a/hal/msm8916/platform.c
+++ b/hal/msm8916/platform.c
@@ -1854,7 +1854,8 @@
snd_device = SND_DEVICE_IN_VOICE_REC_MIC;
}
}
- } else if (source == AUDIO_SOURCE_VOICE_COMMUNICATION) {
+ } else if ((source == AUDIO_SOURCE_VOICE_COMMUNICATION) ||
+ (mode == AUDIO_MODE_IN_COMMUNICATION)) {
if (out_device & AUDIO_DEVICE_OUT_SPEAKER)
in_device = AUDIO_DEVICE_IN_BACK_MIC;
if (adev->active_input) {