diff options
author | Eric Laurent <elaurent@google.com> | 2019-05-09 09:57:38 -0700 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2019-05-09 09:57:38 -0700 |
commit | c8ea9d6a670b75b7e8510b2d04e184e141f431e3 (patch) | |
tree | 1e46e24e7e6126566a2dfa923b7cfc8d698f0f88 | |
parent | 9e84d17d997a1c1b77ffe00f83407f3905dbe62c (diff) | |
parent | bde007c7f0eff9eabee68e7819d0a8c9ae844285 (diff) | |
download | android_hardware_qcom_audio-c8ea9d6a670b75b7e8510b2d04e184e141f431e3.tar.gz android_hardware_qcom_audio-c8ea9d6a670b75b7e8510b2d04e184e141f431e3.tar.bz2 android_hardware_qcom_audio-c8ea9d6a670b75b7e8510b2d04e184e141f431e3.zip |
Merge "hal: Modify A2DP output routing post releaseAudioPatch" into qt-dev
am: bde007c7f0
Change-Id: I417add02df9cf2747a0d59791a2f3b695b443efd
-rw-r--r-- | hal/audio_hw.c | 11 | ||||
-rw-r--r-- | hal/audio_hw.h | 1 |
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, |