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

Commit 36ab8b78 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

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

Change-Id: Ifd897bad2bc0f3042f5077fdd03fbc5c9d9e477b
parents 38fc5cdc b8b62bc6
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) {