Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 19259136 authored by Chris Manton's avatar Chris Manton
Browse files

stack::l2cap: Properly name L2CA_Register2 => L2CA_RegisterWithSecurity

Bug: 343941946
Test: m .
Flag: EXEMPT, Mechanical Refactor

Change-Id: I7414241506c78067200c94d27dc9fd1aad4ed062
parent 7a51b108
Loading
Loading
Loading
Loading
+6 −5
Original line number Diff line number Diff line
@@ -62,8 +62,9 @@ void AVCT_Register() {
  memset(&avct_cb, 0, sizeof(tAVCT_CB));

  /* register PSM with L2CAP */
  if (!L2CA_Register2(AVCT_PSM, avct_l2c_appl, true /* enable_snoop */, nullptr,
                      kAvrcMtu, 0, BTA_SEC_AUTHENTICATE)) {
  if (!L2CA_RegisterWithSecurity(AVCT_PSM, avct_l2c_appl,
                                 true /* enable_snoop */, nullptr, kAvrcMtu, 0,
                                 BTA_SEC_AUTHENTICATE)) {
    log::error(
        "Unable to register with L2CAP AVCT profile psm:AVCT_PSM[0x0017]");
  }
@@ -72,9 +73,9 @@ void AVCT_Register() {
  tL2CAP_ERTM_INFO ertm_info;
  ertm_info.preferred_mode = L2CAP_FCR_ERTM_MODE;

  if (!L2CA_Register2(AVCT_BR_PSM, avct_l2c_br_appl, true /*enable_snoop*/,
                      &ertm_info, kAvrcBrMtu, AVCT_MIN_BROWSE_MTU,
                      BTA_SEC_AUTHENTICATE)) {
  if (!L2CA_RegisterWithSecurity(AVCT_BR_PSM, avct_l2c_br_appl,
                                 true /*enable_snoop*/, &ertm_info, kAvrcBrMtu,
                                 AVCT_MIN_BROWSE_MTU, BTA_SEC_AUTHENTICATE)) {
    log::error(
        "Unable to register with L2CAP AVCT_BR profile "
        "psm:AVCT_BR_PSM[0x001b]");
+3 −2
Original line number Diff line number Diff line
@@ -98,8 +98,9 @@ void avdt_scb_transport_channel_timer_timeout(void* data) {
 ******************************************************************************/
void AVDT_Register(AvdtpRcb* p_reg, tAVDT_CTRL_CBACK* p_cback) {
  /* register PSM with L2CAP */
  if (!L2CA_Register2(AVDT_PSM, avdt_l2c_appl, true /* enable_snoop */, nullptr,
                      kAvdtpMtu, 0, BTA_SEC_AUTHENTICATE)) {
  if (!L2CA_RegisterWithSecurity(AVDT_PSM, avdt_l2c_appl,
                                 true /* enable_snoop */, nullptr, kAvdtpMtu, 0,
                                 BTA_SEC_AUTHENTICATE)) {
    log::error(
        "Unable to register with L2CAP profile AVDT psm:AVDT_PSM[0x0019]");
  }
+4 −3
Original line number Diff line number Diff line
@@ -89,8 +89,9 @@ tBNEP_RESULT bnep_register_with_l2cap(void) {
  bnep_cb.reg_info.pL2CA_Error_Cb = bnep_on_l2cap_error;

  /* Now, register with L2CAP */
  if (!L2CA_Register2(BT_PSM_BNEP, bnep_cb.reg_info, false /* enable_snoop */,
                      nullptr, BNEP_MTU_SIZE, BNEP_MTU_SIZE,
  if (!L2CA_RegisterWithSecurity(BT_PSM_BNEP, bnep_cb.reg_info,
                                 false /* enable_snoop */, nullptr,
                                 BNEP_MTU_SIZE, BNEP_MTU_SIZE,
                                 BTA_SEC_AUTHENTICATE | BTA_SEC_ENCRYPT)) {
    log::error("BNEP - Registration failed");
    return BNEP_SECURITY_FAIL;
+2 −2
Original line number Diff line number Diff line
@@ -74,7 +74,7 @@ class FakeBtStack {
                           "assert failed: p_bd_addr == kDummyRemoteAddr");
          return kDummyCid;
        };
    test::mock::stack_l2cap_api::L2CA_Register2.body =
    test::mock::stack_l2cap_api::L2CA_RegisterWithSecurity.body =
        [](uint16_t psm, const tL2CAP_APPL_INFO& p_cb_info, bool enable_snoop,
           tL2CAP_ERTM_INFO* p_ertm_info, uint16_t my_mtu,
           uint16_t required_remote_mtu, uint16_t sec_level) {
@@ -95,7 +95,7 @@ class FakeBtStack {
    test::mock::stack_l2cap_api::L2CA_DataWrite = {};
    test::mock::stack_l2cap_api::L2CA_ConnectReqWithSecurity = {};
    test::mock::stack_l2cap_api::L2CA_DisconnectReq = {};
    test::mock::stack_l2cap_api::L2CA_Register2 = {};
    test::mock::stack_l2cap_api::L2CA_RegisterWithSecurity = {};
    test::mock::stack_l2cap_api::L2CA_Deregister = {};
  }
};
+2 −2
Original line number Diff line number Diff line
@@ -70,7 +70,7 @@ class FakeBtStack {
              "assert failed: p_bd_addr == kDummyRemoteAddr");
          return kDummyCid;
        };
    test::mock::stack_l2cap_api::L2CA_Register2.body =
    test::mock::stack_l2cap_api::L2CA_RegisterWithSecurity.body =
        [](uint16_t psm, const tL2CAP_APPL_INFO& p_cb_info, bool enable_snoop,
           tL2CAP_ERTM_INFO* p_ertm_info, uint16_t my_mtu,
           uint16_t required_remote_mtu, uint16_t sec_level) {
@@ -84,7 +84,7 @@ class FakeBtStack {
    test::mock::stack_l2cap_api::L2CA_DataWrite = {};
    test::mock::stack_l2cap_api::L2CA_ConnectReqWithSecurity = {};
    test::mock::stack_l2cap_api::L2CA_DisconnectReq = {};
    test::mock::stack_l2cap_api::L2CA_Register2 = {};
    test::mock::stack_l2cap_api::L2CA_RegisterWithSecurity = {};
    test::mock::stack_l2cap_api::L2CA_Deregister = {};
  }
};
Loading