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

Commit 2c751d90 authored by Chienyuan's avatar Chienyuan Committed by Chienyuan Huang
Browse files

Inti enabled_sets_ after get advertising_api_type_

Bug: 240301722
Test: gd/cert/run
Test: ./bluetooth_test_gd_unit64 --gtest_filter=*AdvertisingAPITest*
Tag: #refactor
BYPASS_LONG_LINES_REASON: Bluetooth likes 120 lines

Change-Id: I9b34e64d060389b0528dc9f21635e8b65d823780
Merged-In: I9b34e64d060389b0528dc9f21635e8b65d823780
parent fb342e04
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -114,10 +114,6 @@ struct LeAdvertisingManager::impl : public bluetooth::hci::LeAddressManagerCallb
    le_advertising_interface_ =
        hci_layer_->GetLeAdvertisingInterface(module_handler_->BindOn(this, &LeAdvertisingManager::impl::handle_event));
    num_instances_ = controller_->GetLeNumberOfSupportedAdverisingSets();
    enabled_sets_ = std::vector<EnabledSet>(num_instances_);
    for (size_t i = 0; i < enabled_sets_.size(); i++) {
      enabled_sets_[i].advertising_handle_ = kInvalidHandle;
    }

    if (controller_->SupportsBleExtendedAdvertising()) {
      advertising_api_type_ = AdvertisingApiType::EXTENDED;
@@ -138,6 +134,10 @@ struct LeAdvertisingManager::impl : public bluetooth::hci::LeAddressManagerCallb
            handler->BindOnceOn(this, &impl::on_read_advertising_physical_channel_tx_power));
      }
    }
    enabled_sets_ = std::vector<EnabledSet>(num_instances_);
    for (size_t i = 0; i < enabled_sets_.size(); i++) {
      enabled_sets_[i].advertising_handle_ = kInvalidHandle;
    }
  }

  size_t GetNumberOfAdvertisingInstances() const {