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

Commit 249d8d25 authored by Chris Manton's avatar Chris Manton
Browse files

Use tACL_CONN::SupportsSecureConnections

Towards encapsulated code

Bug: 163134718
Tag: #refactor
Test: gd/cert/run --host

Change-Id: I7bfe087dcc28cfaeb492db1e1a6ec276e1e29ce2
parent 2f1a0338
Loading
Loading
Loading
Loading
+7 −9
Original line number Diff line number Diff line
@@ -1357,7 +1357,7 @@ bool BTM_PeerSupportsSecureConnections(const RawAddress& bd_addr) {
    return false;
  }

  return (p_dev_rec->remote_supports_secure_connections);
  return (p_dev_rec->SupportsSecureConnections());
}

/************************************************************************
@@ -1453,11 +1453,12 @@ tBTM_STATUS btm_sec_l2cap_access_req_by_requirement(
        controller_get_interface()->supports_secure_connections();
    /* acceptor receives L2CAP Channel Connect Request for Secure Connections
     * Only service */
    if (!local_supports_sc || !p_dev_rec->remote_supports_secure_connections) {
    if (!local_supports_sc || !p_dev_rec->SupportsSecureConnections()) {
      LOG_WARN(
          "Policy requires mode 4 level 4, but local_support_for_sc=%d, "
          "rmt_support_for_sc=%d, failing connection",
          local_supports_sc, p_dev_rec->remote_supports_secure_connections);
          "rmt_support_for_sc=%s, failing connection",
          local_supports_sc,
          logbool(p_dev_rec->SupportsSecureConnections()).c_str());
      if (p_callback) {
        (*p_callback)(&bd_addr, transport, (void*)p_ref_data,
                      BTM_MODE4_LEVEL4_NOT_SUPPORTED);
@@ -1800,13 +1801,11 @@ tBTM_STATUS btm_sec_mx_access_request(const RawAddress& bd_addr,
        controller_get_interface()->supports_secure_connections();
    /* acceptor receives service connection establishment Request for */
    /* Secure Connections Only service */
    if (!(local_supports_sc) ||
        !(p_dev_rec->remote_supports_secure_connections)) {
    if (!(local_supports_sc) || !(p_dev_rec->SupportsSecureConnections())) {
      BTM_TRACE_DEBUG("%s: SC only service,local_support_for_sc %d,",
                      "remote_support_for_sc %d: fail pairing", __func__,
                      local_supports_sc,
                      p_dev_rec->remote_supports_secure_connections);

      if (p_callback)
        (*p_callback)(&bd_addr, transport, (void*)p_ref_data,
                      BTM_MODE4_LEVEL4_NOT_SUPPORTED);
@@ -2479,8 +2478,7 @@ void btm_io_capabilities_req(const RawAddress& p) {
    bool local_supports_sc =
        controller_get_interface()->supports_secure_connections();
    /* device in Secure Connections Only mode */
    if (!(local_supports_sc) ||
        !(p_dev_rec->remote_supports_secure_connections)) {
    if (!(local_supports_sc) || !(p_dev_rec->SupportsSecureConnections())) {
      BTM_TRACE_DEBUG("%s: SC only service, local_support_for_sc %d,",
                      " remote_support_for_sc 0x%02x -> fail pairing", __func__,
                      local_supports_sc,