Loading android/app/src/com/android/bluetooth/gatt/AppScanStats.java +8 −5 Original line number Diff line number Diff line Loading @@ -185,8 +185,9 @@ import com.android.bluetooth.btservice.BluetoothProto; long scanDuration = stopTime - scan.timestamp; scan.duration = scanDuration; if (scan.isSuspended) { scan.suspendDuration += stopTime - scan.suspendStartTime; mTotalSuspendTime += scan.suspendDuration; long suspendDuration = stopTime - scan.suspendStartTime; scan.suspendDuration += suspendDuration; mTotalSuspendTime += suspendDuration; } ongoingScans.remove(scannerId); if (lastScans.size() >= NUM_SCAN_DURATIONS_KEPT) { Loading Loading @@ -230,13 +231,15 @@ import com.android.bluetooth.btservice.BluetoothProto; synchronized void recordScanResume(int scannerId) { LastScan scan = getScanFromScannerId(scannerId); long suspendDuration = 0; if (scan == null || !scan.isSuspended) { return; } scan.isSuspended = false; stopTime = SystemClock.elapsedRealtime(); scan.suspendDuration += stopTime - scan.suspendStartTime; mTotalSuspendTime += scan.suspendDuration; suspendDuration = stopTime - scan.suspendStartTime; scan.suspendDuration += suspendDuration; mTotalSuspendTime += suspendDuration; } synchronized void setScanTimeout(int scannerId) { Loading android/app/src/com/android/bluetooth/gatt/ScanManager.java +4 −1 Original line number Diff line number Diff line Loading @@ -260,10 +260,13 @@ public class ScanManager { } if (!mScanNative.isOpportunisticScanClient(client) && !isScreenOn() && !isFiltered) { Log.e(TAG, Log.w(TAG, "Cannot start unfiltered scan in screen-off. This scan will be resumed later: " + client.scannerId); mSuspendedScanClients.add(client); if (client.stats != null) { client.stats.recordScanSuspend(client.scannerId); } return; } Loading Loading
android/app/src/com/android/bluetooth/gatt/AppScanStats.java +8 −5 Original line number Diff line number Diff line Loading @@ -185,8 +185,9 @@ import com.android.bluetooth.btservice.BluetoothProto; long scanDuration = stopTime - scan.timestamp; scan.duration = scanDuration; if (scan.isSuspended) { scan.suspendDuration += stopTime - scan.suspendStartTime; mTotalSuspendTime += scan.suspendDuration; long suspendDuration = stopTime - scan.suspendStartTime; scan.suspendDuration += suspendDuration; mTotalSuspendTime += suspendDuration; } ongoingScans.remove(scannerId); if (lastScans.size() >= NUM_SCAN_DURATIONS_KEPT) { Loading Loading @@ -230,13 +231,15 @@ import com.android.bluetooth.btservice.BluetoothProto; synchronized void recordScanResume(int scannerId) { LastScan scan = getScanFromScannerId(scannerId); long suspendDuration = 0; if (scan == null || !scan.isSuspended) { return; } scan.isSuspended = false; stopTime = SystemClock.elapsedRealtime(); scan.suspendDuration += stopTime - scan.suspendStartTime; mTotalSuspendTime += scan.suspendDuration; suspendDuration = stopTime - scan.suspendStartTime; scan.suspendDuration += suspendDuration; mTotalSuspendTime += suspendDuration; } synchronized void setScanTimeout(int scannerId) { Loading
android/app/src/com/android/bluetooth/gatt/ScanManager.java +4 −1 Original line number Diff line number Diff line Loading @@ -260,10 +260,13 @@ public class ScanManager { } if (!mScanNative.isOpportunisticScanClient(client) && !isScreenOn() && !isFiltered) { Log.e(TAG, Log.w(TAG, "Cannot start unfiltered scan in screen-off. This scan will be resumed later: " + client.scannerId); mSuspendedScanClients.add(client); if (client.stats != null) { client.stats.recordScanSuspend(client.scannerId); } return; } Loading