hal: remove output device force switch from bt sco to handset
Trailing sound may leak to handset after doing force switch
from bt sco output device.
Since when a2dp device is selected, all active output streams
will also route to a2dp during check_usecases_codec_backend,
then a2dp and bt sco won't be active concurrently. But sco
input device can be concurrent with a2dp device, so only
check force switch of input device when SCO is off.
Change-Id: I8225859dc9a3da987ace6cee3225c375785d3bea
diff --git a/hal/audio_hw.c b/hal/audio_hw.c
index 94c9c50..faaf865 100644
--- a/hal/audio_hw.c
+++ b/hal/audio_hw.c
@@ -8110,16 +8110,13 @@
if (strcmp(value, AUDIO_PARAMETER_VALUE_ON) == 0){
adev->bt_sco_on = true;
} else {
- ALOGD("sco is off, reset sco and route device to handset/mic");
+ ALOGD("sco is off, reset sco and route device to handset mic");
adev->bt_sco_on = false;
audio_extn_sco_reset_configuration();
list_for_each(node, &adev->usecase_list) {
usecase = node_to_item(node, struct audio_usecase, list);
- if ((usecase->type == PCM_PLAYBACK) && usecase->stream.out &&
- (usecase->stream.out->devices & AUDIO_DEVICE_OUT_ALL_SCO))
- usecase->stream.out->devices = AUDIO_DEVICE_OUT_EARPIECE;
- else if ((usecase->type == PCM_CAPTURE) && usecase->stream.in &&
- (usecase->stream.in->device & AUDIO_DEVICE_IN_ALL_SCO))
+ if ((usecase->type == PCM_CAPTURE) && usecase->stream.in &&
+ (usecase->stream.in->device & AUDIO_DEVICE_IN_ALL_SCO))
usecase->stream.in->device = AUDIO_DEVICE_IN_BUILTIN_MIC;
else
continue;