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

Commit e0be735f authored by Chienyuan's avatar Chienyuan Committed by Chienyuan Huang
Browse files

gd: Check address policy before advertising

Tag: #gd-refactor
Bug: 188926539
Test: gd/cert/run
Test: bluetooth_test_gd
BYPASS_LONG_LINES_REASON: Bluetooth likes 120 lines

Change-Id: Ic2b0a1c394e1ba5bb25dd51ec295256e242d5c75
parent 88a113df
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -251,7 +251,13 @@ struct LeAdvertisingManager::impl : public bluetooth::hci::LeAddressManagerCallb
          set_data(id, true, config.scan_response);
        }
        set_data(id, false, config.advertisement);
        auto address_policy = le_address_manager_->GetAddressPolicy();
        if (address_policy == LeAddressManager::AddressPolicy::USE_NON_RESOLVABLE_ADDRESS ||
            address_policy == LeAddressManager::AddressPolicy::USE_RESOLVABLE_ADDRESS) {
          advertising_sets_[id].current_address = le_address_manager_->GetAnotherAddress();
        } else {
          advertising_sets_[id].current_address = le_address_manager_->GetCurrentAddress();
        }
        le_advertising_interface_->EnqueueCommand(
            hci::LeMultiAdvtSetRandomAddrBuilder::Create(advertising_sets_[id].current_address.GetAddress(), id),
            module_handler_->BindOnce(impl::check_status<LeMultiAdvtCompleteView>));