OSDN Git Service

bta: Only call get_acl_data_size_ble for LE
authorMyles Watson <mylesgw@google.com>
Thu, 3 May 2018 18:13:55 +0000 (11:13 -0700)
committerMyles Watson <mylesgw@google.com>
Thu, 10 May 2018 23:25:44 +0000 (16:25 -0700)
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
(cherry picked from commit a11bb2dcc23304a2d211f8b5237a5f5bff325880)

bta/jv/bta_jv_act.cc

index 87e5052..69fa3f2 100644 (file)
@@ -941,7 +941,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);
@@ -1089,7 +1089,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))) ||