summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Laurent <elaurent@google.com>2019-05-09 15:49:13 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2019-05-09 15:49:13 +0000
commitbde007c7f0eff9eabee68e7819d0a8c9ae844285 (patch)
tree1e46e24e7e6126566a2dfa923b7cfc8d698f0f88
parentbac127b2972fc9425e09e948f7f2eccc649c4e78 (diff)
parent8f270269d00bbbe82c3f12d26131111ece165f82 (diff)
downloadandroid_hardware_qcom_audio-bde007c7f0eff9eabee68e7819d0a8c9ae844285.tar.gz
android_hardware_qcom_audio-bde007c7f0eff9eabee68e7819d0a8c9ae844285.tar.bz2
android_hardware_qcom_audio-bde007c7f0eff9eabee68e7819d0a8c9ae844285.zip
Merge "hal: Modify A2DP output routing post releaseAudioPatch" into qt-dev
-rw-r--r--hal/audio_hw.c11
-rw-r--r--hal/audio_hw.h1
2 files changed, 11 insertions, 1 deletions
diff --git a/hal/audio_hw.c b/hal/audio_hw.c
index 517351e3..e0c2fce6 100644
--- a/hal/audio_hw.c
+++ b/hal/audio_hw.c
@@ -2881,7 +2881,8 @@ static int out_set_parameters(struct audio_stream *stream, const char *kvpairs)
*/
if ((out->devices & AUDIO_DEVICE_OUT_BLUETOOTH_A2DP) &&
(val == AUDIO_DEVICE_NONE) &&
- !audio_extn_a2dp_is_ready()) {
+ !audio_extn_a2dp_is_ready() &&
+ !adev->bt_sco_on) {
val = AUDIO_DEVICE_OUT_SPEAKER;
}
@@ -5349,6 +5350,14 @@ static int adev_set_parameters(struct audio_hw_device *dev, const char *kvpairs)
adev->bt_wb_speech_enabled = !strcmp(value, AUDIO_PARAMETER_VALUE_ON);
}
+ ret = str_parms_get_str(parms, "BT_SCO", value, sizeof(value));
+ if (ret >= 0) {
+ if (strcmp(value, AUDIO_PARAMETER_VALUE_ON) == 0)
+ adev->bt_sco_on = true;
+ else
+ adev->bt_sco_on = false;
+ }
+
ret = str_parms_get_str(parms, AUDIO_PARAMETER_DEVICE_CONNECT, value, sizeof(value));
if (ret >= 0) {
audio_devices_t device = (audio_devices_t)strtoul(value, NULL, 10);
diff --git a/hal/audio_hw.h b/hal/audio_hw.h
index 09926501..e8fe65b7 100644
--- a/hal/audio_hw.h
+++ b/hal/audio_hw.h
@@ -421,6 +421,7 @@ struct audio_device {
/* logging */
snd_device_t last_logged_snd_device[AUDIO_USECASE_MAX][2]; /* [out, in] */
int camera_orientation; /* CAMERA_BACK_LANDSCAPE ... CAMERA_FRONT_PORTRAIT */
+ bool bt_sco_on;
};
int select_devices(struct audio_device *adev,