hal: use consistent in call indication
Use voice_is_in_call() instead of mode == MODE_IN_CALL
as a valid indication that we are in call to choose sound
devices.
Change-Id: Iefa968ee463d4ade6c7d09626be667faab6eda98
diff --git a/hal/audio_hw.c b/hal/audio_hw.c
index c4ad4c9..58fcea4 100644
--- a/hal/audio_hw.c
+++ b/hal/audio_hw.c
@@ -1786,13 +1786,16 @@
if (!out->standby)
select_devices(adev, out->usecase);
- if ((adev->mode == AUDIO_MODE_IN_CALL) &&
- output_drives_call(adev, out)) {
- adev->current_call_output = out;
- if (!voice_is_in_call(adev))
- ret = voice_start_call(adev);
- else
+ if (output_drives_call(adev, out)) {
+ if(!voice_is_in_call(adev)) {
+ if (adev->mode == AUDIO_MODE_IN_CALL) {
+ adev->current_call_output = out;
+ ret = voice_start_call(adev);
+ }
+ } else {
+ adev->current_call_output = out;
voice_update_devices_for_all_voice_usecases(adev);
+ }
}
}