Loading system/btif/src/btif_av.cc +24 −0 Original line number Diff line number Diff line Loading @@ -63,6 +63,10 @@ #include "stack/include/main_thread.h" #include "types/raw_address.h" #ifdef __ANDROID__ #include <android/sysprop/BluetoothProperties.sysprop.h> #endif using namespace bluetooth; /***************************************************************************** Loading Loading @@ -3465,7 +3469,27 @@ bool btif_av_both_enable(void) { return (btif_av_sink.Enabled() && btif_av_source.Enabled()); } bool is_a2dp_source_property_enabled(void) { #ifdef __ANDROID__ return android::sysprop::BluetoothProperties::isProfileA2dpSourceEnabled() .value_or(false); #else return false; #endif } bool is_a2dp_sink_property_enabled(void) { #ifdef __ANDROID__ return android::sysprop::BluetoothProperties::isProfileA2dpSinkEnabled() .value_or(false); #else return false; #endif } bool btif_av_src_sink_coexist_enabled(void) { if (IS_FLAG_ENABLED(a2dp_concurrent_source_sink)) { return is_a2dp_sink_property_enabled() && is_a2dp_source_property_enabled(); } return GET_SYSPROP(A2dp, src_sink_coexist, false); } Loading system/stack/Android.bp +1 −0 Original line number Diff line number Diff line Loading @@ -68,6 +68,7 @@ cc_library_static { "packages/modules/Bluetooth/system", "packages/modules/Bluetooth/system/bta/include", "packages/modules/Bluetooth/system/bta/sys", "packages/modules/Bluetooth/system/btif/include", "packages/modules/Bluetooth/system/device/include", "packages/modules/Bluetooth/system/gd", "packages/modules/Bluetooth/system/gd/hal", Loading system/stack/avct/avct_bcb_act.cc +2 −2 Original line number Diff line number Diff line Loading @@ -27,13 +27,13 @@ #define LOG_TAG "bluetooth" #include <android_bluetooth_sysprop.h> #include <bluetooth/log.h> #include <string.h> #include "avct_api.h" #include "avct_int.h" #include "bta/include/bta_sec_api.h" #include "btif/include/btif_av.h" #include "internal_include/bt_target.h" #include "osi/include/allocator.h" #include "osi/include/osi.h" Loading Loading @@ -550,7 +550,7 @@ void avct_bcb_msg_ind(tAVCT_BCB* p_bcb, tAVCT_LCB_EVT* p_data) { } bool bind = false; if (GET_SYSPROP(A2dp, src_sink_coexist, false)) { if (btif_av_src_sink_coexist_enabled()) { bind = avct_msg_ind_for_src_sink_coexist(p_lcb, p_data, label, cr_ipid); osi_free_and_reset((void**)&p_data->p_buf); if (bind) return; Loading system/stack/avct/avct_l2c.cc +2 −2 Original line number Diff line number Diff line Loading @@ -23,11 +23,11 @@ ******************************************************************************/ #define LOG_TAG "avctp" #include <android_bluetooth_sysprop.h> #include <bluetooth/log.h> #include "avct_api.h" #include "avct_int.h" #include "btif/include/btif_av.h" #include "internal_include/bt_target.h" #include "l2c_api.h" #include "l2cdefs.h" Loading Loading @@ -146,7 +146,7 @@ void avct_l2c_connect_ind_cback(const RawAddress& bd_addr, uint16_t lcid, /* if result ok, proceed with connection */ if (result == L2CAP_CONN_OK) { if (GET_SYSPROP(A2dp, src_sink_coexist, false)) { if (btif_av_src_sink_coexist_enabled()) { tAVCT_CCB* p_ccb = &avct_cb.ccb[0]; for (int i = 0; i < AVCT_NUM_CONN; i++, p_ccb++) { if (p_ccb && p_ccb->allocated && (p_ccb->p_lcb == NULL) && Loading system/stack/avct/avct_lcb_act.cc +3 −3 Original line number Diff line number Diff line Loading @@ -22,13 +22,13 @@ * ******************************************************************************/ #include <android_bluetooth_flags.h> #include <android_bluetooth_sysprop.h> #include <bluetooth/log.h> #include <string.h> #include "avct_api.h" #include "avct_int.h" #include "bta/include/bta_sec_api.h" #include "btif/include/btif_av.h" #include "device/include/device_iot_config.h" #include "internal_include/bt_target.h" #include "osi/include/allocator.h" Loading Loading @@ -227,7 +227,7 @@ void avct_lcb_open_ind(tAVCT_LCB* p_lcb, tAVCT_LCB_EVT* p_data) { int i; bool bind = false; if (GET_SYSPROP(A2dp, src_sink_coexist, false)) { if (btif_av_src_sink_coexist_enabled()) { bool is_originater = false; for (i = 0; i < AVCT_NUM_CONN; i++, p_ccb++) { Loading Loading @@ -680,7 +680,7 @@ void avct_lcb_msg_ind(tAVCT_LCB* p_lcb, tAVCT_LCB_EVT* p_data) { } bool bind = false; if (GET_SYSPROP(A2dp, src_sink_coexist, false)) { if (btif_av_src_sink_coexist_enabled()) { bind = avct_msg_ind_for_src_sink_coexist(p_lcb, p_data, label, cr_ipid); osi_free_and_reset((void**)&p_data->p_buf); if (bind) return; Loading Loading
system/btif/src/btif_av.cc +24 −0 Original line number Diff line number Diff line Loading @@ -63,6 +63,10 @@ #include "stack/include/main_thread.h" #include "types/raw_address.h" #ifdef __ANDROID__ #include <android/sysprop/BluetoothProperties.sysprop.h> #endif using namespace bluetooth; /***************************************************************************** Loading Loading @@ -3465,7 +3469,27 @@ bool btif_av_both_enable(void) { return (btif_av_sink.Enabled() && btif_av_source.Enabled()); } bool is_a2dp_source_property_enabled(void) { #ifdef __ANDROID__ return android::sysprop::BluetoothProperties::isProfileA2dpSourceEnabled() .value_or(false); #else return false; #endif } bool is_a2dp_sink_property_enabled(void) { #ifdef __ANDROID__ return android::sysprop::BluetoothProperties::isProfileA2dpSinkEnabled() .value_or(false); #else return false; #endif } bool btif_av_src_sink_coexist_enabled(void) { if (IS_FLAG_ENABLED(a2dp_concurrent_source_sink)) { return is_a2dp_sink_property_enabled() && is_a2dp_source_property_enabled(); } return GET_SYSPROP(A2dp, src_sink_coexist, false); } Loading
system/stack/Android.bp +1 −0 Original line number Diff line number Diff line Loading @@ -68,6 +68,7 @@ cc_library_static { "packages/modules/Bluetooth/system", "packages/modules/Bluetooth/system/bta/include", "packages/modules/Bluetooth/system/bta/sys", "packages/modules/Bluetooth/system/btif/include", "packages/modules/Bluetooth/system/device/include", "packages/modules/Bluetooth/system/gd", "packages/modules/Bluetooth/system/gd/hal", Loading
system/stack/avct/avct_bcb_act.cc +2 −2 Original line number Diff line number Diff line Loading @@ -27,13 +27,13 @@ #define LOG_TAG "bluetooth" #include <android_bluetooth_sysprop.h> #include <bluetooth/log.h> #include <string.h> #include "avct_api.h" #include "avct_int.h" #include "bta/include/bta_sec_api.h" #include "btif/include/btif_av.h" #include "internal_include/bt_target.h" #include "osi/include/allocator.h" #include "osi/include/osi.h" Loading Loading @@ -550,7 +550,7 @@ void avct_bcb_msg_ind(tAVCT_BCB* p_bcb, tAVCT_LCB_EVT* p_data) { } bool bind = false; if (GET_SYSPROP(A2dp, src_sink_coexist, false)) { if (btif_av_src_sink_coexist_enabled()) { bind = avct_msg_ind_for_src_sink_coexist(p_lcb, p_data, label, cr_ipid); osi_free_and_reset((void**)&p_data->p_buf); if (bind) return; Loading
system/stack/avct/avct_l2c.cc +2 −2 Original line number Diff line number Diff line Loading @@ -23,11 +23,11 @@ ******************************************************************************/ #define LOG_TAG "avctp" #include <android_bluetooth_sysprop.h> #include <bluetooth/log.h> #include "avct_api.h" #include "avct_int.h" #include "btif/include/btif_av.h" #include "internal_include/bt_target.h" #include "l2c_api.h" #include "l2cdefs.h" Loading Loading @@ -146,7 +146,7 @@ void avct_l2c_connect_ind_cback(const RawAddress& bd_addr, uint16_t lcid, /* if result ok, proceed with connection */ if (result == L2CAP_CONN_OK) { if (GET_SYSPROP(A2dp, src_sink_coexist, false)) { if (btif_av_src_sink_coexist_enabled()) { tAVCT_CCB* p_ccb = &avct_cb.ccb[0]; for (int i = 0; i < AVCT_NUM_CONN; i++, p_ccb++) { if (p_ccb && p_ccb->allocated && (p_ccb->p_lcb == NULL) && Loading
system/stack/avct/avct_lcb_act.cc +3 −3 Original line number Diff line number Diff line Loading @@ -22,13 +22,13 @@ * ******************************************************************************/ #include <android_bluetooth_flags.h> #include <android_bluetooth_sysprop.h> #include <bluetooth/log.h> #include <string.h> #include "avct_api.h" #include "avct_int.h" #include "bta/include/bta_sec_api.h" #include "btif/include/btif_av.h" #include "device/include/device_iot_config.h" #include "internal_include/bt_target.h" #include "osi/include/allocator.h" Loading Loading @@ -227,7 +227,7 @@ void avct_lcb_open_ind(tAVCT_LCB* p_lcb, tAVCT_LCB_EVT* p_data) { int i; bool bind = false; if (GET_SYSPROP(A2dp, src_sink_coexist, false)) { if (btif_av_src_sink_coexist_enabled()) { bool is_originater = false; for (i = 0; i < AVCT_NUM_CONN; i++, p_ccb++) { Loading Loading @@ -680,7 +680,7 @@ void avct_lcb_msg_ind(tAVCT_LCB* p_lcb, tAVCT_LCB_EVT* p_data) { } bool bind = false; if (GET_SYSPROP(A2dp, src_sink_coexist, false)) { if (btif_av_src_sink_coexist_enabled()) { bind = avct_msg_ind_for_src_sink_coexist(p_lcb, p_data, label, cr_ipid); osi_free_and_reset((void**)&p_data->p_buf); if (bind) return; Loading