audio: 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 apply
a new route via voice extention.
Bug: 17940126.
Change-Id: I672f2420968e7ffe8c21c9994c5996b15b93ea07
diff --git a/hal/audio_hw.c b/hal/audio_hw.c
index 91df098..0a1ebf8 100644
--- a/hal/audio_hw.c
+++ b/hal/audio_hw.c
@@ -1338,13 +1338,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);
+ }
}
}