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

Commit 591e48a7 authored by Wei Wang's avatar Wei Wang Committed by Android Git Automerger
Browse files

am 5ba69b7a: Fix timestamp parsing issue for full scan results.

* commit '5ba69b7a':
  Fix timestamp parsing issue for full scan results.
parents c48b4082 5ba69b7a
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -1057,6 +1057,7 @@ public class GattService extends ProfileService {
        Log.d(TAG, "Batch record : " + Arrays.toString(batchRecord));
        Set<ScanResult> results = new HashSet<ScanResult>(numRecords);
        int position = 0;
        long now = SystemClock.elapsedRealtimeNanos();
        while (position < batchRecord.length) {
            byte[] address = extractBytes(batchRecord, position, 6);
            // TODO: remove temp hack.
@@ -1068,7 +1069,7 @@ public class GattService extends ProfileService {
            // Skip tx power level.
            position++;
            int rssi = batchRecord[position++];
            long timestampNanos = parseTimestampNanos(extractBytes(batchRecord, position, 2));
            long timestampNanos = now - parseTimestampNanos(extractBytes(batchRecord, position, 2));
            position += 2;

            // Combine advertise packet and scan response packet.