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

Commit a3abd7f1 authored by Chienyuan's avatar Chienyuan Committed by Martin Brabham
Browse files

Set original address as identity address

Bug: 195318725
Tag: #refactor
Test: pair device over BLE, gd/cert/run --device --sl4a LeAdvancedScanningTest.test_scan_filter_device_public_address_with_irk_legacy_pdu_pending_intent
Change-Id: I159d652ca62e608cb815250487de14a8e1372f32
parent 1ff41c14
Loading
Loading
Loading
Loading
+10 −7
Original line number Diff line number Diff line
@@ -1772,6 +1772,16 @@ public class GattService extends ProfileService {
                    + ", originalAddress=" + originalAddress);
        }

        String identityAddress = mAdapterService.getIdentityAddress(address);
        if (!address.equals(identityAddress)) {
            if (VDBG) {
                Log.d(TAG, "found identityAddress of " + address + ", replace originalAddress as "
                        + identityAddress);
            }
            originalAddress = identityAddress;
        }


        byte[] legacyAdvData = Arrays.copyOfRange(advData, 0, 62);

        for (ScanClient client : mScanManager.getRegularScanQueue()) {
@@ -1841,13 +1851,6 @@ public class GattService extends ProfileService {
                continue;
            }

            if (matchResult.getMatchOrigin() == MatchOrigin.ORIGINAL_ADDRESS) {
                result = new ScanResult(BluetoothAdapter.getDefaultAdapter()
                        .getRemoteDevice(originalAddress), eventType, primaryPhy, secondaryPhy,
                        advertisingSid, txPower, rssi, periodicAdvInt, scanRecord,
                        SystemClock.elapsedRealtimeNanos());
            }

            if ((settings.getCallbackType() & ScanSettings.CALLBACK_TYPE_ALL_MATCHES) == 0) {
                if (VDBG) {
                    Log.d(TAG, "Skipping client: CALLBACK_TYPE_ALL_MATCHES");
+6 −0
Original line number Diff line number Diff line
@@ -370,6 +370,12 @@ void BleScannerInterfaceImpl::OnTrackAdvFoundLost(
  AdvertisingTrackInfo track_info = {};
  RawAddress raw_address =
      ToRawAddress(on_found_on_lost_info.advertiser_address);

  if (on_found_on_lost_info.advertiser_address_type != BLE_ADDR_ANONYMOUS) {
    btm_ble_process_adv_addr(raw_address,
                             &on_found_on_lost_info.advertiser_address_type);
  }

  track_info.advertiser_address = raw_address;
  track_info.advertiser_address_type =
      on_found_on_lost_info.advertiser_address_type;