hal: dev_arbi: support more audio devices for arbitration
Add support for more audio devices for RX arbitration,
including speaker, headphones and the combo
speaker/headphones device.
Change-Id: I822fa0b70033ab067f50f7a019a21ef2e300a665
diff --git a/hal/audio_hw.c b/hal/audio_hw.c
index 038c8e7..5dd66e2 100644
--- a/hal/audio_hw.c
+++ b/hal/audio_hw.c
@@ -465,8 +465,10 @@
adev->snd_dev_ref_cnt[snd_device]--;
return -EINVAL;
}
+ audio_extn_dev_arbi_acquire(snd_device);
if (audio_extn_spkr_prot_start_processing(snd_device)) {
ALOGE("%s: spkr_start_processing failed", __func__);
+ audio_extn_dev_arbi_release(snd_device);
return -EINVAL;
}
} else {
@@ -532,9 +534,9 @@
audio_extn_spkr_prot_stop_processing(snd_device);
} else {
audio_route_reset_and_update_path(adev->audio_route, device_name);
- audio_extn_dev_arbi_release(snd_device);
}
+ audio_extn_dev_arbi_release(snd_device);
audio_extn_sound_trigger_update_device_status(snd_device,
ST_EVENT_SND_DEVICE_FREE);
audio_extn_listen_update_device_status(snd_device,