Loading android/app/jni/com_android_bluetooth_hfp.cpp +2 −1 Original line number Diff line number Diff line Loading @@ -560,7 +560,8 @@ static jboolean connectAudioNative(JNIEnv* env, jobject object, return JNI_FALSE; } ALOGI("%s: device %s", __func__, ((RawAddress*)addr)->ToString().c_str()); bt_status_t status = sBluetoothHfpInterface->ConnectAudio((RawAddress*)addr); bt_status_t status = sBluetoothHfpInterface->ConnectAudio((RawAddress*)addr, false); if (status != BT_STATUS_SUCCESS) { ALOGE("Failed HF audio connection, status: %d", status); } Loading system/bta/ag/bta_ag_api.cc +7 −5 Original line number Diff line number Diff line Loading @@ -159,16 +159,18 @@ void BTA_AgClose(uint16_t handle) { * Function BTA_AgAudioOpen * * Description Opens an audio connection to the currently connected * headset or handsfree. * headset or handsfree. Specifying force_cvsd to true to * force the stack to use CVSD even if mSBC is supported. * * * Returns void * ******************************************************************************/ void BTA_AgAudioOpen(uint16_t handle) { do_in_main_thread( FROM_HERE, base::Bind(&bta_ag_sm_execute_by_handle, handle, BTA_AG_API_AUDIO_OPEN_EVT, tBTA_AG_DATA::kEmpty)); void BTA_AgAudioOpen(uint16_t handle, bool force_cvsd) { tBTA_AG_DATA data = {}; data.api_audio_open.force_cvsd = force_cvsd; do_in_main_thread(FROM_HERE, base::Bind(&bta_ag_sm_execute_by_handle, handle, BTA_AG_API_AUDIO_OPEN_EVT, data)); } /******************************************************************************* Loading system/bta/ag/bta_ag_int.h +6 −0 Original line number Diff line number Diff line Loading @@ -134,6 +134,11 @@ typedef struct { RawAddress bd_addr; } tBTA_AG_API_OPEN; /* data type for BTA_AG_API_AUDIO_OPEN_EVT */ typedef struct { bool force_cvsd; } tBTA_AG_API_AUDIO_OPEN; /* data type for BTA_AG_API_RESULT_EVT */ typedef struct { tBTA_AG_RES result; Loading Loading @@ -162,6 +167,7 @@ typedef struct { union tBTA_AG_DATA { tBTA_AG_API_REGISTER api_register; tBTA_AG_API_OPEN api_open; tBTA_AG_API_AUDIO_OPEN api_audio_open; tBTA_AG_API_RESULT api_result; tBTA_AG_API_SETCODEC api_setcodec; tBTA_AG_DISC_RESULT disc_result; Loading system/bta/ag/bta_ag_sco.cc +6 −0 Original line number Diff line number Diff line Loading @@ -1178,6 +1178,12 @@ void bta_ag_sco_open(tBTA_AG_SCB* p_scb, UNUSED_ATTR const tBTA_AG_DATA& data) { LOG(INFO) << __func__ << ": not opening sco, by policy"; return; } if (data.api_audio_open.force_cvsd) { LOG(INFO) << __func__ << ": set to use fallback codec"; p_scb->codec_fallback = true; } /* if another scb using sco, this is a transfer */ if (bta_ag_cb.sco.p_curr_scb && bta_ag_cb.sco.p_curr_scb != p_scb) { LOG(INFO) << __func__ << ": transfer " Loading system/bta/include/bta_ag_api.h +3 −2 Original line number Diff line number Diff line Loading @@ -568,13 +568,14 @@ void BTA_AgClose(uint16_t handle); * Function BTA_AgAudioOpen * * Description Opens an audio connection to the currently connected * headset or hnadsfree * headset or handsfree. Specifying force_cvsd to true to * force the stack to use CVSD even if mSBC is supported. * * * Returns void * ******************************************************************************/ void BTA_AgAudioOpen(uint16_t handle); void BTA_AgAudioOpen(uint16_t handle, bool force_cvsd); /******************************************************************************* * Loading Loading
android/app/jni/com_android_bluetooth_hfp.cpp +2 −1 Original line number Diff line number Diff line Loading @@ -560,7 +560,8 @@ static jboolean connectAudioNative(JNIEnv* env, jobject object, return JNI_FALSE; } ALOGI("%s: device %s", __func__, ((RawAddress*)addr)->ToString().c_str()); bt_status_t status = sBluetoothHfpInterface->ConnectAudio((RawAddress*)addr); bt_status_t status = sBluetoothHfpInterface->ConnectAudio((RawAddress*)addr, false); if (status != BT_STATUS_SUCCESS) { ALOGE("Failed HF audio connection, status: %d", status); } Loading
system/bta/ag/bta_ag_api.cc +7 −5 Original line number Diff line number Diff line Loading @@ -159,16 +159,18 @@ void BTA_AgClose(uint16_t handle) { * Function BTA_AgAudioOpen * * Description Opens an audio connection to the currently connected * headset or handsfree. * headset or handsfree. Specifying force_cvsd to true to * force the stack to use CVSD even if mSBC is supported. * * * Returns void * ******************************************************************************/ void BTA_AgAudioOpen(uint16_t handle) { do_in_main_thread( FROM_HERE, base::Bind(&bta_ag_sm_execute_by_handle, handle, BTA_AG_API_AUDIO_OPEN_EVT, tBTA_AG_DATA::kEmpty)); void BTA_AgAudioOpen(uint16_t handle, bool force_cvsd) { tBTA_AG_DATA data = {}; data.api_audio_open.force_cvsd = force_cvsd; do_in_main_thread(FROM_HERE, base::Bind(&bta_ag_sm_execute_by_handle, handle, BTA_AG_API_AUDIO_OPEN_EVT, data)); } /******************************************************************************* Loading
system/bta/ag/bta_ag_int.h +6 −0 Original line number Diff line number Diff line Loading @@ -134,6 +134,11 @@ typedef struct { RawAddress bd_addr; } tBTA_AG_API_OPEN; /* data type for BTA_AG_API_AUDIO_OPEN_EVT */ typedef struct { bool force_cvsd; } tBTA_AG_API_AUDIO_OPEN; /* data type for BTA_AG_API_RESULT_EVT */ typedef struct { tBTA_AG_RES result; Loading Loading @@ -162,6 +167,7 @@ typedef struct { union tBTA_AG_DATA { tBTA_AG_API_REGISTER api_register; tBTA_AG_API_OPEN api_open; tBTA_AG_API_AUDIO_OPEN api_audio_open; tBTA_AG_API_RESULT api_result; tBTA_AG_API_SETCODEC api_setcodec; tBTA_AG_DISC_RESULT disc_result; Loading
system/bta/ag/bta_ag_sco.cc +6 −0 Original line number Diff line number Diff line Loading @@ -1178,6 +1178,12 @@ void bta_ag_sco_open(tBTA_AG_SCB* p_scb, UNUSED_ATTR const tBTA_AG_DATA& data) { LOG(INFO) << __func__ << ": not opening sco, by policy"; return; } if (data.api_audio_open.force_cvsd) { LOG(INFO) << __func__ << ": set to use fallback codec"; p_scb->codec_fallback = true; } /* if another scb using sco, this is a transfer */ if (bta_ag_cb.sco.p_curr_scb && bta_ag_cb.sco.p_curr_scb != p_scb) { LOG(INFO) << __func__ << ": transfer " Loading
system/bta/include/bta_ag_api.h +3 −2 Original line number Diff line number Diff line Loading @@ -568,13 +568,14 @@ void BTA_AgClose(uint16_t handle); * Function BTA_AgAudioOpen * * Description Opens an audio connection to the currently connected * headset or hnadsfree * headset or handsfree. Specifying force_cvsd to true to * force the stack to use CVSD even if mSBC is supported. * * * Returns void * ******************************************************************************/ void BTA_AgAudioOpen(uint16_t handle); void BTA_AgAudioOpen(uint16_t handle, bool force_cvsd); /******************************************************************************* * Loading