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

Commit 822798d3 authored by William Escande's avatar William Escande Committed by Cherrypicker Worker
Browse files

BTM delay auth: config from build time to runtime

replace define BTM_DELAY_AUTH_MS with systemproperties
bluetooth.btm.sec.delay_auth_ms.value

Bug: 263323082
Test: Build + TH
Change-Id: I455a21426de7b490d91c6aa5b55b72ced543ec42
(cherry picked from commit f2213d05)
Merged-In: I455a21426de7b490d91c6aa5b55b72ced543ec42
parent f1b2021f
Loading
Loading
Loading
Loading
+0 −4
Original line number Diff line number Diff line
@@ -1026,10 +1026,6 @@

#include "bt_trace.h"

#ifndef BTM_DELAY_AUTH_MS
#define BTM_DELAY_AUTH_MS 0
#endif

#ifndef BTM_DISABLE_CONCURRENT_PEER_AUTH
#define BTM_DISABLE_CONCURRENT_PEER_AUTH FALSE
#endif
+7 −2
Original line number Diff line number Diff line
@@ -44,6 +44,7 @@
#include "osi/include/compat.h"
#include "osi/include/log.h"
#include "osi/include/osi.h"
#include "osi/include/properties.h"
#include "stack/btm/btm_dev.h"
#include "stack/btm/security_device_record.h"
#include "stack/eatt/eatt.h"
@@ -4498,12 +4499,16 @@ static bool btm_sec_start_get_name(tBTM_SEC_DEV_REC* p_dev_rec) {
static void btm_sec_wait_and_start_authentication(tBTM_SEC_DEV_REC* p_dev_rec) {
  p_dev_rec->sec_state = BTM_SEC_STATE_AUTHENTICATING;
  auto addr = new RawAddress(p_dev_rec->bd_addr);

  static const int32_t delay_auth =
      osi_property_get_int32("bluetooth.btm.sec.delay_auth_ms.value", 0);

  bt_status_t status = do_in_main_thread_delayed(
      FROM_HERE, base::Bind(&btm_sec_auth_timer_timeout, addr),
#if BASE_VER < 931007
      base::TimeDelta::FromMilliseconds(BTM_DELAY_AUTH_MS));
      base::TimeDelta::FromMilliseconds(delay_auth));
#else
      base::Milliseconds(BTM_DELAY_AUTH_MS));
      base::Milliseconds(delay_auth));
#endif
  if (status != BT_STATUS_SUCCESS) {
    LOG(ERROR) << __func__