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

Commit 00d81639 authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "Add scan result logs."

parents 33acead6 015ab24c
Loading
Loading
Loading
Loading
+12 −1
Original line number Diff line number Diff line
@@ -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);
                }
            });