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

Commit b6d2c5d2 authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge changes Ic2b0a1c3,I45daa89f

* changes:
  gd: Check address policy before advertising
  gd: Do not send scan disable command if not enabled
parents a08f3ffa e0be735f
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>));
+4 −0
Original line number Diff line number Diff line
@@ -589,6 +589,10 @@ struct LeScanningManager::impl : public bluetooth::hci::LeAddressManagerCallback
  }

  void stop_scan() {
    if (!is_scanning_) {
      LOG_INFO("Scanning already stopped, return!");
      return;
    }
    is_scanning_ = false;

    switch (api_type_) {