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

Commit 9d48f7ed authored by Ajay Panicker's avatar Ajay Panicker
Browse files

Fix logic for repeated record scan calls

If recordStartScan or recordStopScan is called multiple times,
there are issues where logged values are incorrect.

Bug: 27294154
Change-Id: Ie049e917ae26fec4c50874ed703e404146c15044
parent fcdb8bd4
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -79,6 +79,9 @@ import com.android.bluetooth.btservice.BluetoothProto;
        }

        void recordScanStart(ScanSettings settings) {
            if (isScanning)
                return;

            this.scansStarted++;
            isScanning = true;
            startTime = System.currentTimeMillis();
@@ -106,6 +109,9 @@ import com.android.bluetooth.btservice.BluetoothProto;
        }

        void recordScanStop() {
            if (!isScanning)
              return;

            this.scansStopped++;
            isScanning = false;
            stopTime = System.currentTimeMillis();