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

Commit 73768687 authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge "gd: Find and fill TX Power with the correct value" am: b8b62bc6 am: 36ab8b78

Original change: https://android-review.googlesource.com/c/platform/system/bt/+/1689575

Change-Id: Ic3bde5dc792f0fe397168beeea55a088bb5fda34
parents 10897cd8 36ab8b78
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -429,6 +429,7 @@ struct LeAdvertisingManager::impl : public bluetooth::hci::LeAddressManagerCallb

  void set_parameters(AdvertiserId advertiser_id, ExtendedAdvertisingConfig config) {
    advertising_sets_[advertiser_id].connectable = config.connectable;
    advertising_sets_[advertiser_id].tx_power = config.tx_power;

    switch (advertising_api_type_) {
      case (AdvertisingApiType::LEGACY): {
@@ -547,6 +548,14 @@ struct LeAdvertisingManager::impl : public bluetooth::hci::LeAddressManagerCallb
      data.insert(data.begin(), gap_data);
    }

    // Find and fill TX Power with the correct value.
    for (auto& gap_data : data) {
      if (gap_data.data_type_ == GapDataType::TX_POWER_LEVEL) {
        gap_data.data_[0] = advertising_sets_[advertiser_id].tx_power;
        break;
      }
    }

    switch (advertising_api_type_) {
      case (AdvertisingApiType::LEGACY): {
        if (set_scan_rsp) {