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

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

Re-route read LE local/remote address to L2cap

Test: cert/run
Tag: #gd-refactor
Bug: 141555841
Change-Id: I8b2e77d4907a038406d3212771705f16c048d317
parent d4fbd152
Loading
Loading
Loading
Loading
+13 −0
Original line number Diff line number Diff line
@@ -2329,6 +2329,13 @@ void BTM_ReadConnectionAddr(const RawAddress& remote_bda,
    return bluetooth::shim::BTM_ReadConnectionAddr(remote_bda, local_conn_addr,
                                                   p_addr_type);
  }

  if (bluetooth::shim::is_gd_l2cap_enabled()) {
    bluetooth::shim::L2CA_ReadConnectionAddr(remote_bda, local_conn_addr,
                                             p_addr_type);
    return;
  }

  tACL_CONN* p_acl = internal_.btm_bda_to_acl(remote_bda, BT_TRANSPORT_LE);

  if (p_acl == NULL) {
@@ -2485,6 +2492,12 @@ bool BTM_ReadRemoteConnectionAddr(const RawAddress& pseudo_addr,
    return bluetooth::shim::BTM_ReadRemoteConnectionAddr(pseudo_addr, conn_addr,
                                                         p_addr_type);
  }

  if (bluetooth::shim::is_gd_l2cap_enabled()) {
    return bluetooth::shim::L2CA_ReadRemoteConnectionAddr(
        pseudo_addr, conn_addr, p_addr_type);
  }

  bool st = true;
  tACL_CONN* p_acl = internal_.btm_bda_to_acl(pseudo_addr, BT_TRANSPORT_LE);

+11 −0
Original line number Diff line number Diff line
@@ -85,6 +85,17 @@ bool bluetooth::shim::L2CA_IsLeLink(uint16_t) {
  mock_function_count_map[__func__]++;
  return false;
}
void bluetooth::shim::L2CA_ReadConnectionAddr(const RawAddress& pseudo_addr,
                                              RawAddress& conn_addr,
                                              uint8_t* p_addr_type) {
  mock_function_count_map[__func__]++;
}
bool bluetooth::shim::L2CA_ReadRemoteConnectionAddr(
    const RawAddress& pseudo_addr, RawAddress& conn_addr,
    uint8_t* p_addr_type) {
  mock_function_count_map[__func__]++;
  return false;
}
bool bluetooth::shim::L2CA_ReconfigCreditBasedConnsReq(
    const RawAddress& bd_addr, std::vector<uint16_t>& lcids,
    tL2CAP_LE_CFG_INFO* p_cfg) {