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

Commit 21bfca2e authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Replace build time authentication config with runtime" am: d641f3e3

parents fb990370 d641f3e3
Loading
Loading
Loading
Loading
+0 −4
Original line number Diff line number Diff line
@@ -1027,8 +1027,4 @@

#include "bt_trace.h"

#ifndef BTM_DISABLE_CONCURRENT_PEER_AUTH
#define BTM_DISABLE_CONCURRENT_PEER_AUTH FALSE
#endif

#endif /* BT_TARGET_H */
+12 −7
Original line number Diff line number Diff line
@@ -156,6 +156,14 @@ static void NotifyBondingChange(tBTM_SEC_DEV_REC& p_dev_rec,
  }
}

static bool concurrentPeerAuthIsEnabled() {
  // Was previously named BTM_DISABLE_CONCURRENT_PEER_AUTH.
  // Renamed to ENABLED for homogeneity with system properties
  static const bool sCONCURRENT_PEER_AUTH_IS_ENABLED = osi_property_get_bool(
      "bluetooth.btm.sec.concurrent_peer_auth.enabled", true);
  return sCONCURRENT_PEER_AUTH_IS_ENABLED;
}

void NotifyBondingCanceled(tBTM_STATUS btm_status) {
  if (btm_cb.api.p_bond_cancel_cmpl_callback) {
    btm_cb.api.p_bond_cancel_cmpl_callback(BTM_SUCCESS);
@@ -3415,11 +3423,9 @@ void btm_sec_encrypt_change(uint16_t handle, tHCI_STATUS status,
                      __func__, p_dev_rec, p_dev_rec->p_callback);
      p_dev_rec->p_callback = NULL;
      l2cu_resubmit_pending_sec_req(&p_dev_rec->bd_addr);
#ifdef BTM_DISABLE_CONCURRENT_PEER_AUTH
    } else if (BTM_DISABLE_CONCURRENT_PEER_AUTH &&
    } else if (!concurrentPeerAuthIsEnabled() &&
               p_dev_rec->sec_state == BTM_SEC_STATE_AUTHENTICATING) {
      p_dev_rec->sec_state = BTM_SEC_STATE_IDLE;
#endif
    }
    return;
  }
@@ -4048,10 +4054,9 @@ void btm_sec_link_key_request(const uint8_t* p_event) {
  tBTM_SEC_DEV_REC* p_dev_rec = btm_find_or_alloc_dev(bda);

  VLOG(2) << __func__ << " bda: " << bda;
#if (defined(BTM_DISABLE_CONCURRENT_PEER_AUTH) && \
     (BTM_DISABLE_CONCURRENT_PEER_AUTH == TRUE))
  if (!concurrentPeerAuthIsEnabled()) {
    p_dev_rec->sec_state = BTM_SEC_STATE_AUTHENTICATING;
#endif
  }

  if ((btm_cb.pairing_state == BTM_PAIR_STATE_WAIT_PIN_REQ) &&
      (btm_cb.collision_start_time != 0) &&