diff options
| author | 2021-12-16 04:29:41 +0000 | |
|---|---|---|
| committer | 2021-12-16 04:29:41 +0000 | |
| commit | 00d8163936a4ef40c130a8912d2222f2a1880f33 (patch) | |
| tree | e887de5df3658a91ba7caab937e73ce443c24eae | |
| parent | 33acead6f69a7acf40391f226042f5dc97156a36 (diff) | |
| parent | 015ab24c0ab5b01f068a3ac36578a9346c2a9391 (diff) | |
Merge "Add scan result logs."
| -rw-r--r-- | core/java/android/bluetooth/le/BluetoothLeScanner.java | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/core/java/android/bluetooth/le/BluetoothLeScanner.java b/core/java/android/bluetooth/le/BluetoothLeScanner.java index f913349e7955..540e5a778c27 100644 --- a/core/java/android/bluetooth/le/BluetoothLeScanner.java +++ b/core/java/android/bluetooth/le/BluetoothLeScanner.java @@ -514,16 +514,27 @@ public final class BluetoothLeScanner { @Override public void onScanResult(final ScanResult scanResult) { Attributable.setAttributionSource(scanResult, mAttributionSource); + if (Log.isLoggable(TAG, Log.DEBUG)) { + Log.d(TAG, "onScanResult() - mScannerId=" + mScannerId); + } if (VDBG) Log.d(TAG, "onScanResult() - " + scanResult.toString()); // Check null in case the scan has been stopped synchronized (this) { - if (mScannerId <= 0) return; + if (mScannerId <= 0) { + if (Log.isLoggable(TAG, Log.DEBUG)) { + Log.d(TAG, "Ignoring result as scan stopped."); + } + return; + }; } Handler handler = new Handler(Looper.getMainLooper()); handler.post(new Runnable() { @Override public void run() { + if (Log.isLoggable(TAG, Log.DEBUG)) { + Log.d(TAG, "onScanResult() - handler run"); + } mScanCallback.onScanResult(ScanSettings.CALLBACK_TYPE_ALL_MATCHES, scanResult); } }); |