summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnver sadhique <akurun@codeaurora.org>2021-08-11 11:19:45 +0530
committerGerrit - the friendly Code Review server <code-review@localhost>2021-08-30 21:16:37 -0700
commita95c9f1633ba8203c9a5a020a87c0cc6661f360b (patch)
tree7c77c1e61a0074216f6beebff2284db53f7fc0a2
parentaf30f0103a50df510a71a12047b5c68b4e3b8a72 (diff)
audio_hal : examine SCO device in the stream list before routing to SCO
when BT_SCO=ON arrive we are routing all usecase to SCO device but sometime SCO device not updated to stream list,so again device switched to previous device. To avoid that we check SCO device availability in the stream list then routing to SCO. Change-Id: I599e07b56527f0e087bb59254b16fcc9ca278520
-rw-r--r--hal/audio_hw.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/hal/audio_hw.c b/hal/audio_hw.c
index 8fc29614..8bf3dacf 100644
--- a/hal/audio_hw.c
+++ b/hal/audio_hw.c
@@ -8763,13 +8763,13 @@ static int adev_set_parameters(struct audio_hw_device *dev, const char *kvpairs)
usecase = node_to_item(node, struct audio_usecase, list);
if (usecase->stream.in && (usecase->type == PCM_CAPTURE ||
usecase->type == VOICE_CALL) &&
- (!is_btsco_device(SND_DEVICE_NONE, usecase->in_snd_device))) {
+ (!is_btsco_device(SND_DEVICE_NONE, usecase->in_snd_device)) && (is_sco_in_device_type(&usecase->stream.in->device_list))) {
ALOGD("BT_SCO ON, switch all in use case to it");
select_devices(adev, usecase->id);
}
if (usecase->stream.out && (usecase->type == PCM_PLAYBACK ||
usecase->type == VOICE_CALL) &&
- (!is_btsco_device(usecase->out_snd_device, SND_DEVICE_NONE))) {
+ (!is_btsco_device(usecase->out_snd_device, SND_DEVICE_NONE)) && (is_sco_out_device_type(&usecase->stream.out->device_list))) {
ALOGD("BT_SCO ON, switch all out use case to it");
select_devices(adev, usecase->id);
}