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

Commit ea979894 authored by Zach Johnson's avatar Zach Johnson
Browse files

Remove unused handle parameter of L2CA_GetIdentifiers, and rename

The only caller never used it.

Bug: 159815595
Test: cert/run --host
Tag: #gd-refactor
Change-Id: Ie199fc628bea81e40e3a4f79634054ceb37e16b8
parent 4f30ac50
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -3297,8 +3297,7 @@ static void bta_av_offload_codec_builder(tBTA_AV_SCB* p_scb,
      p_a2dp_offload->sample_rate = BTAV_A2DP_CODEC_SAMPLE_RATE_96000;
      break;
  }
  if (L2CA_GetIdentifiers(p_scb->l2c_cid, &p_a2dp_offload->l2c_rcid, NULL) ==
      false) {
  if (L2CA_GetRemoteCid(p_scb->l2c_cid, &p_a2dp_offload->l2c_rcid) == false) {
    APPL_TRACE_ERROR("%s: Failed to fetch l2c rcid", __func__);
    return;
  }
+1 −2
Original line number Diff line number Diff line
@@ -262,8 +262,7 @@ bool bluetooth::shim::L2CA_RemoveFixedChnl(uint16_t fixed_cid,
/**
 * Channel hygiene APIs
 */
bool bluetooth::shim::L2CA_GetIdentifiers(uint16_t lcid, uint16_t* rcid,
                                          uint16_t* handle) {
bool bluetooth::shim::L2CA_GetRemoteCid(uint16_t lcid, uint16_t* rcid) {
  LOG_INFO("UNIMPLEMENTED %s", __func__);
  return false;
}
+3 −4
Original line number Diff line number Diff line
@@ -288,11 +288,10 @@ bool L2CA_DisconnectRsp(uint16_t cid);
uint8_t L2CA_DataWrite(uint16_t cid, BT_HDR* p_data);

// Given a local channel identifier, |lcid|, this function returns the bound
// remote channel identifier, |rcid|, and the ACL link handle, |handle|. If
// remote channel identifier, |rcid|. If
// |lcid| is not known or is invalid, this function returns false and does not
// modify the values pointed at by |rcid| and |handle|. |rcid| and |handle| may
// be NULL.
bool L2CA_GetIdentifiers(uint16_t lcid, uint16_t* rcid, uint16_t* handle);
// modify the value pointed at by |rcid|. |rcid| may be NULL.
bool L2CA_GetRemoteCid(uint16_t lcid, uint16_t* rcid);

/*******************************************************************************
 *
+3 −4
Original line number Diff line number Diff line
@@ -564,11 +564,10 @@ extern bool L2CA_DisconnectRsp(uint16_t cid);
extern uint8_t L2CA_DataWrite(uint16_t cid, BT_HDR* p_data);

// Given a local channel identifier, |lcid|, this function returns the bound
// remote channel identifier, |rcid|, and the ACL link handle, |handle|. If
// remote channel identifier, |rcid|. If
// |lcid| is not known or is invalid, this function returns false and does not
// modify the values pointed at by |rcid| and |handle|. |rcid| and |handle| may
// be NULL.
bool L2CA_GetIdentifiers(uint16_t lcid, uint16_t* rcid, uint16_t* handle);
// modify the value pointed at by |rcid|. |rcid| may be NULL.
bool L2CA_GetRemoteCid(uint16_t lcid, uint16_t* rcid);

/*******************************************************************************
 *
+2 −3
Original line number Diff line number Diff line
@@ -992,16 +992,15 @@ bool L2CA_DisconnectRsp(uint16_t cid) {
  return (true);
}

bool L2CA_GetIdentifiers(uint16_t lcid, uint16_t* rcid, uint16_t* handle) {
bool L2CA_GetRemoteCid(uint16_t lcid, uint16_t* rcid) {
  if (bluetooth::shim::is_gd_shim_enabled()) {
    return bluetooth::shim::L2CA_GetIdentifiers(lcid, rcid, handle);
    return bluetooth::shim::L2CA_GetRemoteCid(lcid, rcid);
  }

  tL2C_CCB* control_block = l2cu_find_ccb_by_cid(NULL, lcid);
  if (!control_block) return false;

  if (rcid) *rcid = control_block->remote_cid;
  if (handle) *handle = control_block->p_lcb->handle;

  return true;
}