OSDN Git Service

gd: Remove unneeded client check when setting privacy
authorChris Manton <cmanton@google.com>
Sat, 31 Oct 2020 16:08:14 +0000 (09:08 -0700)
committerChris Manton <cmanton@google.com>
Wed, 4 Nov 2020 18:30:05 +0000 (10:30 -0800)
The check for registered clients can never succeed.

Privacy can only be set once per stack initialization.
No clients may be registered before setting privacy.
Entry ASSERTs ensure the above conditions are validated and true.

Test: gd/cert/run --host
Test: atest --host bluetooth_test_gd
Bug: 171568335
Tag: #refactor
Change-Id: I3fa97028bd104fccae6e37fc1d20196fd6679830

gd/hci/le_address_manager.cc

index 63a6507..2a06b43 100644 (file)
@@ -65,11 +65,6 @@ void LeAddressManager::SetPrivacyPolicyForInitiatorAddress(
       minimum_rotation_time_ = minimum_rotation_time;
       maximum_rotation_time_ = maximum_rotation_time;
       address_rotation_alarm_ = std::make_unique<os::Alarm>(handler_);
-      if (!registered_clients_.empty()) {
-        // clients registered and paused before the policy set, rotate random address and resume
-        // clients after set random address complete
-        handler_->BindOnceOn(this, &LeAddressManager::rotate_random_address).Invoke();
-      }
       break;
     case AddressPolicy::POLICY_NOT_SET:
       LOG_ALWAYS_FATAL("invalid parameters");