summaryrefslogtreecommitdiffstats
path: root/hal
diff options
context:
space:
mode:
authorqctecmdr <qctecmdr@localhost>2019-11-06 20:58:34 -0800
committerGerrit - the friendly Code Review server <code-review@localhost>2019-11-06 20:58:34 -0800
commit5add24ce98396a9961bc0fa4f6483bb4cd41427b (patch)
treeedb5768efe8da2e44390a3582555880c2440a003 /hal
parentdce1690cf28dd3e876f9bdb8b867df315dac75b6 (diff)
parent136e6745f9eb0b65e3b5fb50d88328125bdc907d (diff)
downloadandroid_hardware_qcom_audio-5add24ce98396a9961bc0fa4f6483bb4cd41427b.tar.gz
android_hardware_qcom_audio-5add24ce98396a9961bc0fa4f6483bb4cd41427b.tar.bz2
android_hardware_qcom_audio-5add24ce98396a9961bc0fa4f6483bb4cd41427b.zip
Merge "hal: fix bt sco and a2dp concurrency issues"
Diffstat (limited to 'hal')
-rw-r--r--hal/audio_hw.c22
1 files changed, 15 insertions, 7 deletions
diff --git a/hal/audio_hw.c b/hal/audio_hw.c
index d97f517c..54f037d1 100644
--- a/hal/audio_hw.c
+++ b/hal/audio_hw.c
@@ -8133,7 +8133,6 @@ static int adev_set_parameters(struct audio_hw_device *dev, const char *kvpairs)
int status = 0;
bool a2dp_reconfig = false;
struct listnode *node;
- struct audio_usecase *usecase = NULL;
ALOGD("%s: enter: %s", __func__, kvpairs);
parms = str_parms_create_str(kvpairs);
@@ -8165,17 +8164,26 @@ static int adev_set_parameters(struct audio_hw_device *dev, const char *kvpairs)
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");
adev->bt_sco_on = false;
audio_extn_sco_reset_configuration();
+ }
+ }
+
+ ret = str_parms_get_str(parms, "A2dpSuspended", value, sizeof(value));
+ if (ret>=0) {
+ if (!strncmp(value, "false", 5) &&
+ audio_extn_a2dp_source_is_suspended()) {
+ struct audio_usecase *usecase;
+ struct listnode *node;
list_for_each(node, &adev->usecase_list) {
usecase = node_to_item(node, struct audio_usecase, list);
- if ((usecase->type == PCM_CAPTURE) && usecase->stream.in &&
- (usecase->stream.in->device & AUDIO_DEVICE_IN_ALL_SCO))
+ if (usecase->stream.in && (usecase->type == PCM_CAPTURE) &&
+ ((usecase->stream.in->device & ~AUDIO_DEVICE_BIT_IN) &
+ AUDIO_DEVICE_IN_ALL_SCO)) {
+ ALOGD("a2dp resumed, switch bt sco mic to handset mic");
usecase->stream.in->device = AUDIO_DEVICE_IN_BUILTIN_MIC;
- else
- continue;
- select_devices(adev, usecase->id);
+ select_devices(adev, usecase->id);
+ }
}
}
}