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

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

Merge "gd Scanning: Ignore non-anonymous advertising report with empty address" am: 6ecf56d0

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

Change-Id: If213df1d8634443abf538e385a10347840681062
parents e958ae67 6ecf56d0
Loading
Loading
Loading
Loading
+19 −1
Original line number Diff line number Diff line
@@ -365,7 +365,25 @@ struct LeScanningManager::impl : public bluetooth::hci::LeAddressManagerCallback
    bool is_scannable = event_type & (1 << kScannableBit);
    bool is_scan_response = event_type & (1 << kScanResponseBit);
    bool is_legacy = event_type & (1 << kLegacyBit);
    // TODO handle anonymous advertisement (0xFF)

    if (address_type == (uint8_t)DirectAdvertisingAddressType::NO_ADDRESS) {
      scanning_callbacks_->OnScanResult(
          event_type,
          address_type,
          address,
          primary_phy,
          secondary_phy,
          advertising_sid,
          tx_power,
          rssi,
          periodic_advertising_interval,
          advertising_data);
      return;
    } else if (address == Address::kEmpty) {
      LOG_WARN("Receive non-anonymous advertising report with empty address, skip!");
      return;
    }

    AddressWithType address_with_type(address, (AddressType)address_type);

    if (is_legacy && is_scan_response && !advertising_cache_.Exist(address_with_type)) {