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

Commit d4a20c20 authored by Chienyuan's avatar Chienyuan
Browse files

gd: Prevent legacy address rotation when GD enabled

Tag: #gd-refactor
Bug: 177044452
Test: gd/cert/run --host
Test: manual
Change-Id: Ib9f8ace378704077d4375ca2a46eeab20f92aef0
parent 6e434610
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -32,6 +32,7 @@
#include "hcimsgs.h"

#include "btm_ble_int.h"
#include "main/shim/shim.h"
#include "stack/btm/btm_dev.h"
#include "stack/crypto_toolbox/crypto_toolbox.h"
#include "stack/include/acl_api.h"
@@ -72,6 +73,14 @@ static void btm_ble_refresh_raddr_timer_timeout(UNUSED_ATTR void* data) {
/** This function is called when random address for local controller was
 * generated */
void btm_gen_resolve_paddr_low(const RawAddress& address) {
  /* when GD advertising and scanning modules are enabled, set random address
   * via address manager in GD */
  if (bluetooth::shim::is_gd_advertising_enabled() &&
      bluetooth::shim::is_gd_scanning_enabled()) {
    LOG_INFO("GD advertising and scanning modules are enabled, skip");
    return;
  }

  tBTM_LE_RANDOM_CB* p_cb = &btm_cb.ble_ctr_cb.addr_mgnt_cb;
  p_cb->private_addr = address;