OSDN Git Service

sock->fixed_chane is always false, and remove unused code
authorHansong Zhang <hsz@google.com>
Thu, 27 Aug 2020 22:25:31 +0000 (15:25 -0700)
committerHansong Zhang <hsz@google.com>
Thu, 27 Aug 2020 22:25:31 +0000 (15:25 -0700)
Bug: 159815595
Tag: #refactor
Test: compile & verify basic functions working
Change-Id: I4e7f5c4a61072535affb5f448fb98096dd1ffa4b

bta/include/bta_jv_api.h
bta/jv/bta_jv_act.cc
bta/jv/bta_jv_api.cc
bta/jv/bta_jv_int.h
btif/src/btif_sock_l2cap.cc

index 7dcab2b..080d95f 100644 (file)
@@ -554,23 +554,6 @@ void BTA_JvL2capStartServer(int conn_type, tBTA_SEC sec_mask, tBTA_JV_ROLE role,
 
 /*******************************************************************************
  *
- * Function         BTA_JvL2capStartServerLE
- *
- * Description      This function starts an LE L2CAP server and listens for an
- *                  L2CAP connection from a remote Bluetooth device on a fixed
- *                  channel over an LE link.  When the server
- *                  is started successfully, tBTA_JV_L2CAP_CBACK is called with
- *                  BTA_JV_L2CAP_START_EVT.  When the connection is established,
- *                  tBTA_JV_L2CAP_CBACK is called with BTA_JV_L2CAP_OPEN_EVT.
- *
- * Returns          void
- *
- ******************************************************************************/
-void BTA_JvL2capStartServerLE(uint16_t local_chan, tBTA_JV_L2CAP_CBACK* p_cback,
-                              uint32_t l2cap_socket_id);
-
-/*******************************************************************************
- *
  * Function         BTA_JvL2capStopServerLE
  *
  * Description      This function stops the LE L2CAP server. If the server has
index 0e68755..42e43c5 100644 (file)
@@ -2131,31 +2131,6 @@ void bta_jv_l2cap_stop_server_le(uint16_t local_chan) {
   }
 }
 
-/** starts an LE L2CAP server */
-void bta_jv_l2cap_start_server_le(uint16_t local_chan,
-                                  tBTA_JV_L2CAP_CBACK* p_cback,
-                                  uint32_t l2cap_socket_id) {
-  tBTA_JV_L2CAP_START evt_data;
-  evt_data.handle = GAP_INVALID_HANDLE;
-  evt_data.status = BTA_JV_FAILURE;
-
-  struct fc_client* t = fcclient_alloc(local_chan, true, NULL);
-  if (!t) goto out;
-
-  t->p_cback = p_cback;
-  t->l2cap_socket_id = l2cap_socket_id;
-
-  // if we got here, we're registered...
-  evt_data.status = BTA_JV_SUCCESS;
-  evt_data.handle = t->id;
-  evt_data.sec_id = t->sec_id;
-
-out:
-  tBTA_JV bta_jv;
-  bta_jv.l2c_start = evt_data;
-  p_cback(BTA_JV_L2CAP_START_EVT, &bta_jv, l2cap_socket_id);
-}
-
 /* close a fixed channel connection. calls no callbacks. idempotent */
 extern void bta_jv_l2cap_close_fixed(uint32_t handle) {
   struct fc_client* t = fcclient_find_by_id(handle);
index f7f60a2..eaedd10 100644 (file)
@@ -307,28 +307,6 @@ void BTA_JvL2capStartServer(int conn_type, tBTA_SEC sec_mask, tBTA_JV_ROLE role,
 
 /*******************************************************************************
  *
- * Function         BTA_JvL2capStartServerLE
- *
- * Description      This function starts an LE L2CAP server and listens for an
- *                  L2CAP connection from a remote Bluetooth device.  When the
- *                  server is started successfully, tBTA_JV_L2CAP_CBACK is
- *                  called with BTA_JV_L2CAP_START_EVT.  When the connection is
- *                  established, tBTA_JV_L2CAP_CBACK is called with
- *                  BTA_JV_L2CAP_OPEN_EVT.
- *
- * Returns          void
- *
- ******************************************************************************/
-void BTA_JvL2capStartServerLE(uint16_t local_chan, tBTA_JV_L2CAP_CBACK* p_cback,
-                              uint32_t l2cap_socket_id) {
-  VLOG(2) << __func__;
-  CHECK(p_cback);
-  do_in_main_thread(FROM_HERE, Bind(&bta_jv_l2cap_start_server_le, local_chan,
-                                    p_cback, l2cap_socket_id));
-}
-
-/*******************************************************************************
- *
  * Function         BTA_JvL2capStopServer
  *
  * Description      This function stops the L2CAP server. If the server has an
index 85adbcd..5b40936 100644 (file)
@@ -184,9 +184,6 @@ extern void bta_jv_rfcomm_write(uint32_t handle, uint32_t req_id,
 extern void bta_jv_set_pm_profile(uint32_t handle, tBTA_JV_PM_ID app_id,
                                   tBTA_JV_CONN_STATE init_st);
 
-extern void bta_jv_l2cap_start_server_le(uint16_t local_chan,
-                                         tBTA_JV_L2CAP_CBACK* p_cback,
-                                         uint32_t l2cap_socket_id);
 extern void bta_jv_l2cap_stop_server_le(uint16_t local_chan);
 extern void bta_jv_l2cap_write_fixed(uint16_t channel, const RawAddress& addr,
                                      uint32_t req_id, BT_HDR* msg,
index 853fe43..917427c 100644 (file)
@@ -837,11 +837,6 @@ static void btsock_l2cap_server_listen(l2cap_socket* sock) {
            << ", channel: " << sock->channel
            << ", is_le_coc: " << sock->is_le_coc;
 
-  if (sock->fixed_chan) {
-    BTA_JvL2capStartServerLE(sock->channel, btsock_l2cap_cbk, sock->id);
-    return;
-  }
-
   int connection_type =
       sock->is_le_coc ? BTA_JV_CONN_TYPE_L2CAP_LE : BTA_JV_CONN_TYPE_L2CAP;