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

Commit d607daa2 authored by Myles Watson's avatar Myles Watson
Browse files

bta: Only call get_acl_data_size_ble for LE

Pass 0xFFFF (max uint16_t) to GAP_ConnOpen, which will call
get_acl_data_size_ble() to correct the value, but only when the
connection type is LE.

Bug: 77495521
Bug: 76192234
Test: Start Bluetooth with a BT 3.0 chip (or a simulated one)
Change-Id: If46ea249081fc058faf09bcb5149f21d8baf7aa7
parent 52443352
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -942,7 +942,7 @@ void bta_jv_l2cap_connect(int32_t type, tBTA_SEC sec_mask, tBTA_JV_ROLE role,
    if ((type != BTA_JV_CONN_TYPE_L2CAP) ||
        (bta_jv_check_psm(remote_psm))) /* allowed */
    {
      uint16_t max_mps = controller_get_interface()->get_acl_data_size_ble();
      uint16_t max_mps = 0xffff;  // Let GAP_ConnOpen set the max_mps.
      handle = GAP_ConnOpen("", sec_id, 0, &peer_bd_addr, remote_psm, max_mps,
                            &cfg, ertm_info.get(), sec_mask, chan_mode_mask,
                            bta_jv_l2cap_client_cback, type);
@@ -1090,7 +1090,7 @@ void bta_jv_l2cap_start_server(int32_t type, tBTA_SEC sec_mask,
  */

  uint8_t sec_id = bta_jv_alloc_sec_id();
  uint16_t max_mps = controller_get_interface()->get_acl_data_size_ble();
  uint16_t max_mps = 0xffff;  // Let GAP_ConnOpen set the max_mps.
  /* PSM checking is not required for LE COC */
  if (0 == sec_id ||
      ((type == BTA_JV_CONN_TYPE_L2CAP) && (!bta_jv_check_psm(local_psm))) ||