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

Commit c9906c10 authored by Hansong Zhang's avatar Hansong Zhang
Browse files

Remove unused code

Bug: 159815595
Tag: #refactor
Test: compile & verify basic functions working
Change-Id: I85be9ef424d55f31902765e6e47350865b0d2e12
parent a1f78cf5
Loading
Loading
Loading
Loading
+0 −27
Original line number Original line Diff line number Diff line
@@ -518,19 +518,6 @@ void BTA_JvL2capConnect(int conn_type, tBTA_SEC sec_mask, tBTA_JV_ROLE role,
 ******************************************************************************/
 ******************************************************************************/
tBTA_JV_STATUS BTA_JvL2capClose(uint32_t handle);
tBTA_JV_STATUS BTA_JvL2capClose(uint32_t handle);


/*******************************************************************************
 *
 * Function         BTA_JvL2capCloseLE
 *
 * Description      This function closes an L2CAP client connection for Fixed
 *                  Channels Function is idempotent and no callbacks are called!
 *
 * Returns          BTA_JV_SUCCESS, if the request is being processed.
 *                  BTA_JV_FAILURE, otherwise.
 *
 ******************************************************************************/
tBTA_JV_STATUS BTA_JvL2capCloseLE(uint32_t handle);

/*******************************************************************************
/*******************************************************************************
 *
 *
 * Function         BTA_JvL2capStartServer
 * Function         BTA_JvL2capStartServer
@@ -624,20 +611,6 @@ tBTA_JV_STATUS BTA_JvL2capReady(uint32_t handle, uint32_t* p_data_size);
tBTA_JV_STATUS BTA_JvL2capWrite(uint32_t handle, uint32_t req_id, BT_HDR* msg,
tBTA_JV_STATUS BTA_JvL2capWrite(uint32_t handle, uint32_t req_id, BT_HDR* msg,
                                uint32_t user_id);
                                uint32_t user_id);


/*******************************************************************************
 *
 * Function         BTA_JvL2capWriteFixed
 *
 * Description      This function writes data to an L2CAP connection
 *                  When the operation is complete, tBTA_JV_L2CAP_CBACK is
 *                  called with BTA_JV_L2CAP_WRITE_FIXED_EVT. Works for
 *                  fixed-channel connections
 *
 ******************************************************************************/
void BTA_JvL2capWriteFixed(uint16_t channel, const RawAddress& addr,
                           uint32_t req_id, tBTA_JV_L2CAP_CBACK* p_cback,
                           BT_HDR* msg, uint32_t user_id);

/*******************************************************************************
/*******************************************************************************
 *
 *
 * Function         BTA_JvRfcommConnect
 * Function         BTA_JvRfcommConnect
+0 −24
Original line number Original line Diff line number Diff line
@@ -1178,24 +1178,6 @@ void bta_jv_l2cap_write(uint32_t handle, uint32_t req_id, BT_HDR* msg,
  p_cb->p_cback(BTA_JV_L2CAP_WRITE_EVT, &bta_jv, user_id);
  p_cb->p_cback(BTA_JV_L2CAP_WRITE_EVT, &bta_jv, user_id);
}
}


/* Write data to an L2CAP connection using Fixed channels */
void bta_jv_l2cap_write_fixed(uint16_t channel, const RawAddress& addr,
                              uint32_t req_id, BT_HDR* msg, uint32_t user_id,
                              tBTA_JV_L2CAP_CBACK* p_cback) {
  tBTA_JV_L2CAP_WRITE_FIXED evt_data;
  evt_data.status = BTA_JV_FAILURE;
  evt_data.channel = channel;
  evt_data.addr = addr;
  evt_data.req_id = req_id;
  evt_data.len = 0;

  L2CA_SendFixedChnlData(channel, addr, msg);

  tBTA_JV bta_jv;
  bta_jv.l2c_write_fixed = evt_data;
  p_cback(BTA_JV_L2CAP_WRITE_FIXED_EVT, &bta_jv, user_id);
}

/*******************************************************************************
/*******************************************************************************
 *
 *
 * Function     bta_jv_port_data_co_cback
 * Function     bta_jv_port_data_co_cback
@@ -2130,9 +2112,3 @@ void bta_jv_l2cap_stop_server_le(uint16_t local_chan) {
    }
    }
  }
  }
}
}

/* 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);
  if (t) fcclient_free(t);
}
+0 −38
Original line number Original line Diff line number Diff line
@@ -258,24 +258,6 @@ tBTA_JV_STATUS BTA_JvL2capClose(uint32_t handle) {
  return BTA_JV_SUCCESS;
  return BTA_JV_SUCCESS;
}
}


/*******************************************************************************
 *
 * Function         BTA_JvL2capCloseLE
 *
 * Description      This function closes an L2CAP client connection for Fixed
 *                  Channels Function is idempotent and no callbacks are called!
 *
 * Returns          BTA_JV_SUCCESS, if the request is being processed.
 *                  BTA_JV_FAILURE, otherwise.
 *
 ******************************************************************************/
tBTA_JV_STATUS BTA_JvL2capCloseLE(uint32_t handle) {
  VLOG(2) << __func__;

  do_in_main_thread(FROM_HERE, Bind(&bta_jv_l2cap_close_fixed, handle));
  return BTA_JV_SUCCESS;
}

/*******************************************************************************
/*******************************************************************************
 *
 *
 * Function         BTA_JvL2capStartServer
 * Function         BTA_JvL2capStartServer
@@ -434,26 +416,6 @@ tBTA_JV_STATUS BTA_JvL2capWrite(uint32_t handle, uint32_t req_id, BT_HDR* msg,
  return BTA_JV_SUCCESS;
  return BTA_JV_SUCCESS;
}
}


/*******************************************************************************
 *
 * Function         BTA_JvL2capWriteFixed
 *
 * Description      This function writes data to an L2CAP connection
 *                  When the operation is complete, tBTA_JV_L2CAP_CBACK is
 *                  called with BTA_JV_L2CAP_WRITE_EVT. Works for
 *                  fixed-channel connections. This function takes ownership of
 *                  p_data, and will osi_free it.
 *
 ******************************************************************************/
void BTA_JvL2capWriteFixed(uint16_t channel, const RawAddress& addr,
                           uint32_t req_id, tBTA_JV_L2CAP_CBACK* p_cback,
                           BT_HDR* msg, uint32_t user_id) {
  VLOG(2) << __func__;

  do_in_main_thread(FROM_HERE, Bind(&bta_jv_l2cap_write_fixed, channel, addr,
                                    req_id, msg, user_id, p_cback));
}

/*******************************************************************************
/*******************************************************************************
 *
 *
 * Function         BTA_JvRfcommConnect
 * Function         BTA_JvRfcommConnect
+0 −5
Original line number Original line Diff line number Diff line
@@ -185,10 +185,5 @@ extern void bta_jv_set_pm_profile(uint32_t handle, tBTA_JV_PM_ID app_id,
                                  tBTA_JV_CONN_STATE init_st);
                                  tBTA_JV_CONN_STATE init_st);


extern void bta_jv_l2cap_stop_server_le(uint16_t local_chan);
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,
                                     uint32_t user_id,
                                     tBTA_JV_L2CAP_CBACK* p_cback);
extern void bta_jv_l2cap_close_fixed(uint32_t handle);


#endif /* BTA_JV_INT_H */
#endif /* BTA_JV_INT_H */