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

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

Remove unnecessary transport param

Can only set packets on classic/BR_EDR

Bug: 163134718
Test: gd/cert/run
Tag: #refactor
Change-Id: Icf38654478a36671775d34c716bb86f6636bbffe
parent 5c0189e3
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -425,7 +425,6 @@ void btm_set_link_policy(tACL_CONN* conn, tLINK_POLICY policy) {
  mock_function_count_map[__func__]++;
}
void btm_set_packet_types_from_address(const RawAddress& bd_addr,
                                       tBT_TRANSPORT transport,
                                       uint16_t pkt_types) {
  mock_function_count_map[__func__]++;
}
+0 −1
Original line number Diff line number Diff line
@@ -424,7 +424,6 @@ void btm_set_link_policy(tACL_CONN* conn, tLINK_POLICY policy) {
  mock_function_count_map[__func__]++;
}
void btm_set_packet_types_from_address(const RawAddress& bd_addr,
                                       tBT_TRANSPORT transport,
                                       uint16_t pkt_types) {
  mock_function_count_map[__func__]++;
}
+4 −12
Original line number Diff line number Diff line
@@ -1401,22 +1401,14 @@ tBTM_STATUS StackAclBtmAcl::btm_set_packet_types(tACL_CONN* p,
}

void btm_set_packet_types_from_address(const RawAddress& bd_addr,
                                       tBT_TRANSPORT transport,
                                       uint16_t pkt_types) {
  if (transport == BT_TRANSPORT_LE) {
    LOG_WARN("Unable to set packet types on le transport");
    return;
  }
  tACL_CONN* p_acl_cb = internal_.btm_bda_to_acl(bd_addr, transport);
  if (p_acl_cb == nullptr) {
  tACL_CONN* p_acl = internal_.btm_bda_to_acl(bd_addr, BT_TRANSPORT_BR_EDR);
  if (p_acl == nullptr) {
    LOG_WARN("Unable to find active acl");
    return;
  }
  if (p_acl_cb->is_transport_ble()) {
    LOG_DEBUG("Unable to set packet types on provided le acl");
    return;
  }
  tBTM_STATUS status = internal_.btm_set_packet_types(p_acl_cb, pkt_types);

  tBTM_STATUS status = internal_.btm_set_packet_types(p_acl, pkt_types);
  if (status != BTM_CMD_STARTED) {
    LOG_ERROR("Unable to set packet types from address");
  }
+2 −2
Original line number Diff line number Diff line
@@ -156,7 +156,7 @@ void avdt_l2c_connect_ind_cback(const RawAddress& bd_addr, uint16_t lcid,
      if (interop_match_addr(INTEROP_2MBPS_LINK_ONLY, &bd_addr)) {
        // Disable 3DH packets for AVDT ACL to improve sensitivity on HS
        btm_set_packet_types_from_address(
            bd_addr, BT_TRANSPORT_BR_EDR,
            bd_addr,
            (acl_get_supported_packet_types() | HCI_PKT_TYPES_MASK_NO_3_DH1 |
             HCI_PKT_TYPES_MASK_NO_3_DH3 | HCI_PKT_TYPES_MASK_NO_3_DH5));
      }
@@ -254,7 +254,7 @@ void avdt_l2c_connect_cfm_cback(uint16_t lcid, uint16_t result) {
                                   (const RawAddress*)&p_ccb->peer_addr)) {
              // Disable 3DH packets for AVDT ACL to improve sensitivity on HS
              btm_set_packet_types_from_address(
                  p_ccb->peer_addr, BT_TRANSPORT_BR_EDR,
                  p_ccb->peer_addr,
                  (acl_get_supported_packet_types() |
                   HCI_PKT_TYPES_MASK_NO_3_DH1 | HCI_PKT_TYPES_MASK_NO_3_DH3 |
                   HCI_PKT_TYPES_MASK_NO_3_DH5));
+1 −2
Original line number Diff line number Diff line
@@ -3576,8 +3576,7 @@ void btm_sec_connected(const RawAddress& bda, uint16_t handle,
  /* For now there are a some devices that do not like sending */
  /* commands events and data at the same time. */
  /* Set the packet types to the default allowed by the device */
  btm_set_packet_types_from_address(bda, BT_TRANSPORT_BR_EDR,
                                    acl_get_supported_packet_types());
  btm_set_packet_types_from_address(bda, acl_get_supported_packet_types());

  /* Initialize security flags.  We need to do that because some            */
  /* authorization complete could have come after the connection is dropped */
Loading