diff options
author | Mingshu Pang <mpang@codeaurora.org> | 2021-04-22 10:35:00 +0800 |
---|---|---|
committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2021-05-16 22:47:28 -0700 |
commit | 651036e2280c3f9ce3a63b237bbaa3c97d6765e4 (patch) | |
tree | 7195a0368dae091c74ab2f0c4367ec93394f6f84 | |
parent | b6dcb0dd1d450c90adafaa286b3db8b11f034cc4 (diff) |
Hal: add voice call usecase to re-select device when SCO ON arrived.
Sometimes routing to bt-sco failed since of the connection status
when setting force use to SCO, but then BT_SCO ON msg arrived, voice
call can't be rerouted.
Add voice call usecase to re-select device when SCO ON arrived to
avoid voice call can't route to right device when SCO state changed.
Change-Id: I1d090bd339817b5248e5d740d9b2956f0c9553e1
-rw-r--r-- | hal/audio_hw.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/hal/audio_hw.c b/hal/audio_hw.c index 9b29a219..17a82b38 100644 --- a/hal/audio_hw.c +++ b/hal/audio_hw.c @@ -8758,12 +8758,14 @@ static int adev_set_parameters(struct audio_hw_device *dev, const char *kvpairs) struct listnode *node; list_for_each(node, &adev->usecase_list) { usecase = node_to_item(node, struct audio_usecase, list); - if (usecase->stream.in && (usecase->type == PCM_CAPTURE) && + if (usecase->stream.in && (usecase->type == PCM_CAPTURE || + usecase->type == VOICE_CALL) && (!is_btsco_device(SND_DEVICE_NONE, usecase->in_snd_device))) { ALOGD("BT_SCO ON, switch all in use case to it"); select_devices(adev, usecase->id); } - if (usecase->stream.out && (usecase->type == PCM_PLAYBACK) && + if (usecase->stream.out && (usecase->type == PCM_PLAYBACK || + usecase->type == VOICE_CALL) && (!is_btsco_device(usecase->out_snd_device, SND_DEVICE_NONE))) { ALOGD("BT_SCO ON, switch all out use case to it"); select_devices(adev, usecase->id); |