Loading system/stack/avct/avct_api.cc +8 −2 Original line number Diff line number Diff line Loading @@ -35,6 +35,7 @@ #include "osi/include/allocator.h" #include "stack/include/bt_hdr.h" #include "types/raw_address.h" #include <com_android_bluetooth_flags.h> using namespace bluetooth; Loading @@ -61,9 +62,14 @@ void AVCT_Register() { /* initialize AVCTP data structures */ memset(&avct_cb, 0, sizeof(tAVCT_CB)); uint16_t sec = BTA_SEC_AUTHENTICATE | BTA_SEC_ENCRYPT; if (!com::android::bluetooth::flags::use_encrypt_req_for_av()) { sec = BTA_SEC_AUTHENTICATE; } /* register PSM with L2CAP */ if (!L2CA_RegisterWithSecurity(AVCT_PSM, avct_l2c_appl, true /* enable_snoop */, nullptr, kAvrcMtu, 0, BTA_SEC_AUTHENTICATE)) { kAvrcMtu, 0, sec)) { log::error("Unable to register with L2CAP AVCT profile psm:AVCT_PSM[0x0017]"); } Loading @@ -72,7 +78,7 @@ void AVCT_Register() { ertm_info.preferred_mode = L2CAP_FCR_ERTM_MODE; if (!L2CA_RegisterWithSecurity(AVCT_BR_PSM, avct_l2c_br_appl, true /*enable_snoop*/, &ertm_info, kAvrcBrMtu, AVCT_MIN_BROWSE_MTU, BTA_SEC_AUTHENTICATE)) { kAvrcBrMtu, AVCT_MIN_BROWSE_MTU, sec)) { log::error( "Unable to register with L2CAP AVCT_BR profile " "psm:AVCT_BR_PSM[0x001b]"); Loading system/stack/avct/avct_bcb_act.cc +8 −1 Original line number Diff line number Diff line Loading @@ -40,6 +40,7 @@ #include "stack/avct/avct_defs.h" #include "stack/include/bt_hdr.h" #include "stack/include/bt_types.h" #include <com_android_bluetooth_flags.h> using namespace bluetooth; Loading Loading @@ -115,7 +116,13 @@ void avct_bcb_chnl_open(tAVCT_BCB* p_bcb, tAVCT_LCB_EVT* /* p_data */) { /* call l2cap connect req */ p_bcb->ch_state = AVCT_CH_CONN; p_bcb->ch_lcid = L2CA_ConnectReqWithSecurity(AVCT_BR_PSM, p_lcb->peer_addr, BTA_SEC_AUTHENTICATE); if (com::android::bluetooth::flags::use_encrypt_req_for_av()) { p_bcb->ch_lcid = L2CA_ConnectReqWithSecurity(AVCT_BR_PSM, p_lcb->peer_addr, BTA_SEC_AUTHENTICATE | BTA_SEC_ENCRYPT); } else { p_bcb->ch_lcid = L2CA_ConnectReqWithSecurity(AVCT_BR_PSM, p_lcb->peer_addr, BTA_SEC_AUTHENTICATE); } if (p_bcb->ch_lcid == 0) { /* if connect req failed, send ourselves close event */ tAVCT_LCB_EVT avct_lcb_evt; Loading system/stack/avct/avct_lcb_act.cc +7 −1 Original line number Diff line number Diff line Loading @@ -187,7 +187,13 @@ void avct_lcb_chnl_open(tAVCT_LCB* p_lcb, tAVCT_LCB_EVT* /* p_data */) { uint16_t result = AVCT_RESULT_FAIL; p_lcb->ch_state = AVCT_CH_CONN; p_lcb->ch_lcid = L2CA_ConnectReqWithSecurity(AVCT_PSM, p_lcb->peer_addr, BTA_SEC_AUTHENTICATE); if (com::android::bluetooth::flags::use_encrypt_req_for_av()) { p_lcb->ch_lcid = L2CA_ConnectReqWithSecurity(AVCT_PSM, p_lcb->peer_addr, BTA_SEC_AUTHENTICATE | BTA_SEC_ENCRYPT); } else { p_lcb->ch_lcid = L2CA_ConnectReqWithSecurity(AVCT_PSM, p_lcb->peer_addr, BTA_SEC_AUTHENTICATE); } if (p_lcb->ch_lcid == 0) { /* if connect req failed, send ourselves close event */ tAVCT_LCB_EVT avct_lcb_evt; Loading system/stack/avdt/avdt_ad.cc +8 −1 Original line number Diff line number Diff line Loading @@ -35,6 +35,7 @@ #include "osi/include/allocator.h" #include "stack/include/bt_hdr.h" #include "stack/include/btm_sec_api_types.h" #include <com_android_bluetooth_flags.h> using namespace bluetooth; Loading Loading @@ -532,7 +533,13 @@ void avdt_ad_open_req(uint8_t type, AvdtpCcb* p_ccb, AvdtpScb* p_scb, uint8_t ro p_tbl->state = AVDT_AD_ST_CONN; /* call l2cap connect req */ lcid = L2CA_ConnectReqWithSecurity(AVDT_PSM, p_ccb->peer_addr, BTM_SEC_OUT_AUTHENTICATE); if (com::android::bluetooth::flags::use_encrypt_req_for_av()) { lcid = L2CA_ConnectReqWithSecurity(AVDT_PSM, p_ccb->peer_addr, BTM_SEC_OUT_AUTHENTICATE | BTM_SEC_OUT_ENCRYPT); } else { lcid = L2CA_ConnectReqWithSecurity(AVDT_PSM, p_ccb->peer_addr, BTM_SEC_OUT_AUTHENTICATE); } if (lcid != 0) { /* if connect req ok, store tcid in lcid table */ avdtp_cb.ad.lcid_tbl[lcid] = avdt_ad_tc_tbl_to_idx(p_tbl); Loading system/stack/avdt/avdt_api.cc +6 −1 Original line number Diff line number Diff line Loading @@ -39,6 +39,7 @@ #include "stack/include/a2dp_codec_api.h" #include "stack/include/bt_hdr.h" #include "types/raw_address.h" #include <com_android_bluetooth_flags.h> using namespace bluetooth; Loading Loading @@ -97,9 +98,13 @@ void avdt_scb_transport_channel_timer_timeout(void* data) { * ******************************************************************************/ void AVDT_Register(AvdtpRcb* p_reg, tAVDT_CTRL_CBACK* p_cback) { uint16_t sec = BTA_SEC_AUTHENTICATE | BTA_SEC_ENCRYPT; if (!com::android::bluetooth::flags::use_encrypt_req_for_av()) { sec = BTA_SEC_AUTHENTICATE; } /* register PSM with L2CAP */ if (!L2CA_RegisterWithSecurity(AVDT_PSM, avdt_l2c_appl, true /* enable_snoop */, nullptr, kAvdtpMtu, 0, BTA_SEC_AUTHENTICATE)) { kAvdtpMtu, 0, sec)) { log::error("Unable to register with L2CAP profile AVDT psm:AVDT_PSM[0x0019]"); } Loading Loading
system/stack/avct/avct_api.cc +8 −2 Original line number Diff line number Diff line Loading @@ -35,6 +35,7 @@ #include "osi/include/allocator.h" #include "stack/include/bt_hdr.h" #include "types/raw_address.h" #include <com_android_bluetooth_flags.h> using namespace bluetooth; Loading @@ -61,9 +62,14 @@ void AVCT_Register() { /* initialize AVCTP data structures */ memset(&avct_cb, 0, sizeof(tAVCT_CB)); uint16_t sec = BTA_SEC_AUTHENTICATE | BTA_SEC_ENCRYPT; if (!com::android::bluetooth::flags::use_encrypt_req_for_av()) { sec = BTA_SEC_AUTHENTICATE; } /* register PSM with L2CAP */ if (!L2CA_RegisterWithSecurity(AVCT_PSM, avct_l2c_appl, true /* enable_snoop */, nullptr, kAvrcMtu, 0, BTA_SEC_AUTHENTICATE)) { kAvrcMtu, 0, sec)) { log::error("Unable to register with L2CAP AVCT profile psm:AVCT_PSM[0x0017]"); } Loading @@ -72,7 +78,7 @@ void AVCT_Register() { ertm_info.preferred_mode = L2CAP_FCR_ERTM_MODE; if (!L2CA_RegisterWithSecurity(AVCT_BR_PSM, avct_l2c_br_appl, true /*enable_snoop*/, &ertm_info, kAvrcBrMtu, AVCT_MIN_BROWSE_MTU, BTA_SEC_AUTHENTICATE)) { kAvrcBrMtu, AVCT_MIN_BROWSE_MTU, sec)) { log::error( "Unable to register with L2CAP AVCT_BR profile " "psm:AVCT_BR_PSM[0x001b]"); Loading
system/stack/avct/avct_bcb_act.cc +8 −1 Original line number Diff line number Diff line Loading @@ -40,6 +40,7 @@ #include "stack/avct/avct_defs.h" #include "stack/include/bt_hdr.h" #include "stack/include/bt_types.h" #include <com_android_bluetooth_flags.h> using namespace bluetooth; Loading Loading @@ -115,7 +116,13 @@ void avct_bcb_chnl_open(tAVCT_BCB* p_bcb, tAVCT_LCB_EVT* /* p_data */) { /* call l2cap connect req */ p_bcb->ch_state = AVCT_CH_CONN; p_bcb->ch_lcid = L2CA_ConnectReqWithSecurity(AVCT_BR_PSM, p_lcb->peer_addr, BTA_SEC_AUTHENTICATE); if (com::android::bluetooth::flags::use_encrypt_req_for_av()) { p_bcb->ch_lcid = L2CA_ConnectReqWithSecurity(AVCT_BR_PSM, p_lcb->peer_addr, BTA_SEC_AUTHENTICATE | BTA_SEC_ENCRYPT); } else { p_bcb->ch_lcid = L2CA_ConnectReqWithSecurity(AVCT_BR_PSM, p_lcb->peer_addr, BTA_SEC_AUTHENTICATE); } if (p_bcb->ch_lcid == 0) { /* if connect req failed, send ourselves close event */ tAVCT_LCB_EVT avct_lcb_evt; Loading
system/stack/avct/avct_lcb_act.cc +7 −1 Original line number Diff line number Diff line Loading @@ -187,7 +187,13 @@ void avct_lcb_chnl_open(tAVCT_LCB* p_lcb, tAVCT_LCB_EVT* /* p_data */) { uint16_t result = AVCT_RESULT_FAIL; p_lcb->ch_state = AVCT_CH_CONN; p_lcb->ch_lcid = L2CA_ConnectReqWithSecurity(AVCT_PSM, p_lcb->peer_addr, BTA_SEC_AUTHENTICATE); if (com::android::bluetooth::flags::use_encrypt_req_for_av()) { p_lcb->ch_lcid = L2CA_ConnectReqWithSecurity(AVCT_PSM, p_lcb->peer_addr, BTA_SEC_AUTHENTICATE | BTA_SEC_ENCRYPT); } else { p_lcb->ch_lcid = L2CA_ConnectReqWithSecurity(AVCT_PSM, p_lcb->peer_addr, BTA_SEC_AUTHENTICATE); } if (p_lcb->ch_lcid == 0) { /* if connect req failed, send ourselves close event */ tAVCT_LCB_EVT avct_lcb_evt; Loading
system/stack/avdt/avdt_ad.cc +8 −1 Original line number Diff line number Diff line Loading @@ -35,6 +35,7 @@ #include "osi/include/allocator.h" #include "stack/include/bt_hdr.h" #include "stack/include/btm_sec_api_types.h" #include <com_android_bluetooth_flags.h> using namespace bluetooth; Loading Loading @@ -532,7 +533,13 @@ void avdt_ad_open_req(uint8_t type, AvdtpCcb* p_ccb, AvdtpScb* p_scb, uint8_t ro p_tbl->state = AVDT_AD_ST_CONN; /* call l2cap connect req */ lcid = L2CA_ConnectReqWithSecurity(AVDT_PSM, p_ccb->peer_addr, BTM_SEC_OUT_AUTHENTICATE); if (com::android::bluetooth::flags::use_encrypt_req_for_av()) { lcid = L2CA_ConnectReqWithSecurity(AVDT_PSM, p_ccb->peer_addr, BTM_SEC_OUT_AUTHENTICATE | BTM_SEC_OUT_ENCRYPT); } else { lcid = L2CA_ConnectReqWithSecurity(AVDT_PSM, p_ccb->peer_addr, BTM_SEC_OUT_AUTHENTICATE); } if (lcid != 0) { /* if connect req ok, store tcid in lcid table */ avdtp_cb.ad.lcid_tbl[lcid] = avdt_ad_tc_tbl_to_idx(p_tbl); Loading
system/stack/avdt/avdt_api.cc +6 −1 Original line number Diff line number Diff line Loading @@ -39,6 +39,7 @@ #include "stack/include/a2dp_codec_api.h" #include "stack/include/bt_hdr.h" #include "types/raw_address.h" #include <com_android_bluetooth_flags.h> using namespace bluetooth; Loading Loading @@ -97,9 +98,13 @@ void avdt_scb_transport_channel_timer_timeout(void* data) { * ******************************************************************************/ void AVDT_Register(AvdtpRcb* p_reg, tAVDT_CTRL_CBACK* p_cback) { uint16_t sec = BTA_SEC_AUTHENTICATE | BTA_SEC_ENCRYPT; if (!com::android::bluetooth::flags::use_encrypt_req_for_av()) { sec = BTA_SEC_AUTHENTICATE; } /* register PSM with L2CAP */ if (!L2CA_RegisterWithSecurity(AVDT_PSM, avdt_l2c_appl, true /* enable_snoop */, nullptr, kAvdtpMtu, 0, BTA_SEC_AUTHENTICATE)) { kAvdtpMtu, 0, sec)) { log::error("Unable to register with L2CAP profile AVDT psm:AVDT_PSM[0x0019]"); } Loading