Loading system/bta/ag/bta_ag_api.cc +7 −2 Original line number Diff line number Diff line Loading @@ -159,7 +159,7 @@ void BTA_AgClose(uint16_t handle) { * Function BTA_AgAudioOpen * * Description Opens an audio connection to the currently connected * headset or hnadsfree. * headset or handsfree. * * * Returns void Loading @@ -176,7 +176,7 @@ void BTA_AgAudioOpen(uint16_t handle) { * Function BTA_AgAudioClose * * Description Close the currently active audio connection to a headset * or hnadsfree. The data connection remains open * or handsfree. The data connection remains open * * * Returns void Loading Loading @@ -225,6 +225,11 @@ void BTA_AgSetCodec(uint16_t handle, tBTA_AG_PEER_CODEC codec) { BTA_AG_API_SETCODEC_EVT, data)); } void BTA_AgSetScoOffloadEnabled(bool value) { do_in_main_thread(FROM_HERE, base::Bind(&bta_ag_set_sco_offload_enabled, value)); } void BTA_AgSetScoAllowed(bool value) { do_in_main_thread(FROM_HERE, base::Bind(&bta_ag_set_sco_allowed, value)); } Loading system/bta/ag/bta_ag_int.h +1 −0 Original line number Diff line number Diff line Loading @@ -404,6 +404,7 @@ extern void bta_ag_handle_collision(tBTA_AG_SCB* p_scb, extern void bta_ag_sco_codec_nego(tBTA_AG_SCB* p_scb, bool result); extern void bta_ag_codec_negotiate(tBTA_AG_SCB* p_scb); extern void bta_ag_send_bcs(tBTA_AG_SCB* p_scb); extern void bta_ag_set_sco_offload_enabled(bool value); extern void bta_ag_set_sco_allowed(bool value); extern const RawAddress& bta_ag_get_active_device(); extern void bta_clear_active_device(); Loading system/bta/ag/bta_ag_sco.cc +4 −0 Original line number Diff line number Diff line Loading @@ -1352,6 +1352,10 @@ void bta_ag_sco_conn_rsp(tBTA_AG_SCB* p_scb, bta_ag_create_pending_sco(p_scb, bta_ag_cb.sco.is_local); } void bta_ag_set_sco_offload_enabled(bool value) { hfp_hal_interface::enable_offload(value); } void bta_ag_set_sco_allowed(bool value) { sco_allowed = value; APPL_TRACE_DEBUG(sco_allowed ? "sco now allowed" : "sco now not allowed"); Loading system/bta/include/bta_ag_api.h +2 −0 Original line number Diff line number Diff line Loading @@ -616,6 +616,8 @@ void BTA_AgResult(uint16_t handle, tBTA_AG_RES result, ******************************************************************************/ void BTA_AgSetCodec(uint16_t handle, tBTA_AG_PEER_CODEC codec); void BTA_AgSetScoOffloadEnabled(bool value); void BTA_AgSetScoAllowed(bool value); void BTA_AgSetActiveDevice(const RawAddress& active_device_addr); Loading system/btif/src/btif_hf.cc +7 −0 Original line number Diff line number Diff line Loading @@ -759,6 +759,7 @@ class HeadsetInterface : Interface { const char* name, RawAddress* bd_addr) override; void Cleanup() override; bt_status_t SetScoOffloadEnabled(bool value) override; bt_status_t SetScoAllowed(bool value) override; bt_status_t SendBsir(bool value, RawAddress* bd_addr) override; bt_status_t SetActiveDevice(RawAddress* active_device_addr) override; Loading Loading @@ -1430,6 +1431,12 @@ void HeadsetInterface::Cleanup() { do_in_jni_thread(FROM_HERE, base::Bind([]() { bt_hf_callbacks = nullptr; })); } bt_status_t HeadsetInterface::SetScoOffloadEnabled(bool value) { CHECK_BTHF_INIT(); BTA_AgSetScoOffloadEnabled(value); return BT_STATUS_SUCCESS; } bt_status_t HeadsetInterface::SetScoAllowed(bool value) { CHECK_BTHF_INIT(); BTA_AgSetScoAllowed(value); Loading Loading
system/bta/ag/bta_ag_api.cc +7 −2 Original line number Diff line number Diff line Loading @@ -159,7 +159,7 @@ void BTA_AgClose(uint16_t handle) { * Function BTA_AgAudioOpen * * Description Opens an audio connection to the currently connected * headset or hnadsfree. * headset or handsfree. * * * Returns void Loading @@ -176,7 +176,7 @@ void BTA_AgAudioOpen(uint16_t handle) { * Function BTA_AgAudioClose * * Description Close the currently active audio connection to a headset * or hnadsfree. The data connection remains open * or handsfree. The data connection remains open * * * Returns void Loading Loading @@ -225,6 +225,11 @@ void BTA_AgSetCodec(uint16_t handle, tBTA_AG_PEER_CODEC codec) { BTA_AG_API_SETCODEC_EVT, data)); } void BTA_AgSetScoOffloadEnabled(bool value) { do_in_main_thread(FROM_HERE, base::Bind(&bta_ag_set_sco_offload_enabled, value)); } void BTA_AgSetScoAllowed(bool value) { do_in_main_thread(FROM_HERE, base::Bind(&bta_ag_set_sco_allowed, value)); } Loading
system/bta/ag/bta_ag_int.h +1 −0 Original line number Diff line number Diff line Loading @@ -404,6 +404,7 @@ extern void bta_ag_handle_collision(tBTA_AG_SCB* p_scb, extern void bta_ag_sco_codec_nego(tBTA_AG_SCB* p_scb, bool result); extern void bta_ag_codec_negotiate(tBTA_AG_SCB* p_scb); extern void bta_ag_send_bcs(tBTA_AG_SCB* p_scb); extern void bta_ag_set_sco_offload_enabled(bool value); extern void bta_ag_set_sco_allowed(bool value); extern const RawAddress& bta_ag_get_active_device(); extern void bta_clear_active_device(); Loading
system/bta/ag/bta_ag_sco.cc +4 −0 Original line number Diff line number Diff line Loading @@ -1352,6 +1352,10 @@ void bta_ag_sco_conn_rsp(tBTA_AG_SCB* p_scb, bta_ag_create_pending_sco(p_scb, bta_ag_cb.sco.is_local); } void bta_ag_set_sco_offload_enabled(bool value) { hfp_hal_interface::enable_offload(value); } void bta_ag_set_sco_allowed(bool value) { sco_allowed = value; APPL_TRACE_DEBUG(sco_allowed ? "sco now allowed" : "sco now not allowed"); Loading
system/bta/include/bta_ag_api.h +2 −0 Original line number Diff line number Diff line Loading @@ -616,6 +616,8 @@ void BTA_AgResult(uint16_t handle, tBTA_AG_RES result, ******************************************************************************/ void BTA_AgSetCodec(uint16_t handle, tBTA_AG_PEER_CODEC codec); void BTA_AgSetScoOffloadEnabled(bool value); void BTA_AgSetScoAllowed(bool value); void BTA_AgSetActiveDevice(const RawAddress& active_device_addr); Loading
system/btif/src/btif_hf.cc +7 −0 Original line number Diff line number Diff line Loading @@ -759,6 +759,7 @@ class HeadsetInterface : Interface { const char* name, RawAddress* bd_addr) override; void Cleanup() override; bt_status_t SetScoOffloadEnabled(bool value) override; bt_status_t SetScoAllowed(bool value) override; bt_status_t SendBsir(bool value, RawAddress* bd_addr) override; bt_status_t SetActiveDevice(RawAddress* active_device_addr) override; Loading Loading @@ -1430,6 +1431,12 @@ void HeadsetInterface::Cleanup() { do_in_jni_thread(FROM_HERE, base::Bind([]() { bt_hf_callbacks = nullptr; })); } bt_status_t HeadsetInterface::SetScoOffloadEnabled(bool value) { CHECK_BTHF_INIT(); BTA_AgSetScoOffloadEnabled(value); return BT_STATUS_SUCCESS; } bt_status_t HeadsetInterface::SetScoAllowed(bool value) { CHECK_BTHF_INIT(); BTA_AgSetScoAllowed(value); Loading