OSDN Git Service

Remove unused data length API
authorHansong Zhang <hsz@google.com>
Wed, 13 Jan 2021 00:34:53 +0000 (16:34 -0800)
committerHansong Zhang <hsz@google.com>
Wed, 13 Jan 2021 19:25:25 +0000 (11:25 -0800)
Test: cert/run
Tag: #gd-refactor
Bug: 141555841
Change-Id: I5ac24f146dfee55b6e15f8bce80f034e6ff7c3c9

stack/include/l2c_api.h
stack/l2cap/l2c_ble.cc
stack/l2cap/l2c_int.h
stack/test/common/mock_main_shim_btm_api.cc
stack/test/common/mock_main_shim_l2c_api.cc

index cd01254..ab5e7c4 100644 (file)
@@ -823,13 +823,6 @@ extern void L2CA_AdjustConnectionIntervals(uint16_t* min_interval,
                                            uint16_t floor_interval);
 
 /**
- * Update max fixed channel tx data length if applicable
- */
-extern void L2CA_SetLeFixedChannelTxDataLength(const RawAddress& remote_bda,
-                                               uint16_t fix_cid,
-                                               uint16_t tx_mtu);
-
-/**
  * Check whether an ACL or LE link to the remote device is established
  */
 extern bool L2CA_IsLinkEstablished(const RawAddress& bd_addr,
index 01675f0..e17e904 100644 (file)
@@ -1353,41 +1353,6 @@ void l2cble_process_data_length_change_event(uint16_t handle,
 
 /*******************************************************************************
  *
- * Function         l2cble_set_fixed_channel_tx_data_length
- *
- * Description      This function update max fixed channel tx data length if
- *                  applicable
- *
- * Returns          void
- *
- ******************************************************************************/
-void l2cble_set_fixed_channel_tx_data_length(const RawAddress& remote_bda,
-                                             uint16_t fix_cid,
-                                             uint16_t tx_mtu) {
-  tL2C_LCB* p_lcb = l2cu_find_lcb_by_bd_addr(remote_bda, BT_TRANSPORT_LE);
-  uint16_t cid = fix_cid - L2CAP_FIRST_FIXED_CHNL;
-
-  L2CAP_TRACE_DEBUG("%s TX MTU = %d", __func__, tx_mtu);
-
-  if (!controller_get_interface()->supports_ble_packet_extension()) {
-    L2CAP_TRACE_WARNING("%s, request not supported", __func__);
-    return;
-  }
-
-  /* See if we have a link control block for the connection */
-  if (p_lcb == NULL) return;
-
-  if (p_lcb->p_fixed_ccbs[cid] != NULL) {
-    if (tx_mtu > BTM_BLE_DATA_SIZE_MAX) tx_mtu = BTM_BLE_DATA_SIZE_MAX;
-
-    p_lcb->p_fixed_ccbs[cid]->tx_data_len = tx_mtu;
-  }
-
-  l2cble_update_data_length(p_lcb);
-}
-
-/*******************************************************************************
- *
  * Function         l2cble_credit_based_conn_req
  *
  * Description      This function sends LE Credit Based Connection Request for
@@ -1637,11 +1602,6 @@ void L2CA_AdjustConnectionIntervals(uint16_t* min_interval,
   }
 }
 
-void L2CA_SetLeFixedChannelTxDataLength(const RawAddress& remote_bda,
-                                        uint16_t fix_cid, uint16_t tx_mtu) {
-  l2cble_set_fixed_channel_tx_data_length(remote_bda, fix_cid, tx_mtu);
-}
-
 void l2cble_use_preferred_conn_params(const RawAddress& bda) {
   tL2C_LCB* p_lcb = l2cu_find_lcb_by_bd_addr(bda, BT_TRANSPORT_LE);
   tBTM_SEC_DEV_REC* p_dev_rec = btm_find_or_alloc_dev(bda);
index 23766aa..feb6fe5 100644 (file)
@@ -802,8 +802,6 @@ extern tL2CAP_LE_RESULT_CODE l2ble_sec_access_req(const RawAddress& bd_addr,
                                                   void* p_ref_data);
 
 extern void l2cble_update_data_length(tL2C_LCB* p_lcb);
-extern void l2cble_set_fixed_channel_tx_data_length(
-    const RawAddress& remote_bda, uint16_t fix_cid, uint16_t tx_mtu);
 
 extern void l2cu_process_fixed_disc_cback(tL2C_LCB* p_lcb);
 
index 13a3f6c..d941f9d 100644 (file)
@@ -179,11 +179,6 @@ tBTM_STATUS bluetooth::shim::BTM_SecBondCancel(const RawAddress& bd_addr) {
   mock_function_count_map[__func__]++;
   return 0;
 }
-tBTM_STATUS bluetooth::shim::BTM_SetBleDataLength(const RawAddress& bd_addr,
-                                                  uint16_t tx_pdu_length) {
-  mock_function_count_map[__func__]++;
-  return 0;
-}
 tBTM_STATUS bluetooth::shim::BTM_SetConnectability(uint16_t page_mode,
                                                    uint16_t window,
                                                    uint16_t interval) {
index 5e07168..5c8a48d 100644 (file)
@@ -76,6 +76,11 @@ bool bluetooth::shim::L2CA_IsLinkEstablished(const RawAddress& bd_addr,
   mock_function_count_map[__func__]++;
   return false;
 }
+uint16_t bluetooth::shim::L2CA_GetLeHandle(uint16_t cid,
+                                           const RawAddress& bd_addr) {
+  mock_function_count_map[__func__]++;
+  return 0;
+}
 bool bluetooth::shim::L2CA_IsLeLink(uint16_t) {
   mock_function_count_map[__func__]++;
   return false;