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

Commit 47870765 authored by Rahul Sabnis's avatar Rahul Sabnis Committed by Automerger Merge Worker
Browse files

Ignore calls to set the address policy after it has already been set am: 3baf1d6f

parents 29cd33da 3baf1d6f
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -51,13 +51,16 @@ void LeAddressManager::SetPrivacyPolicyForInitiatorAddress(
    bool supports_ble_privacy,
    std::chrono::milliseconds minimum_rotation_time,
    std::chrono::milliseconds maximum_rotation_time) {
  // Need to update some parameteres like IRK
  if (supports_ble_privacy && address_policy_ != AddressPolicy::POLICY_NOT_SET) {
  // Handle repeated calls to the function
  if (address_policy_ != AddressPolicy::POLICY_NOT_SET) {
    // Need to update some parameteres like IRK if privacy is supported
    if (supports_ble_privacy) {
      LOG_INFO("Updating rotation parameters.");
      rotation_irk_ = rotation_irk;
      minimum_rotation_time_ = minimum_rotation_time;
      maximum_rotation_time_ = maximum_rotation_time;
      set_random_address();
    }
    return;
  }
  ASSERT(address_policy_ == AddressPolicy::POLICY_NOT_SET);