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

Commit 35e928b3 authored by Kihong Seong's avatar Kihong Seong
Browse files

Add log for registration failure when scanning too frequently

Currently nothing is reported or logged when scanner registration fails
due to scanning too frequently. Thus adding a log for debugging when
scan fails because of this scenario

Bug: 336859000
Test: m com.android.btservices
Flag: EXEMPT, adding logs only
Change-Id: I29f1ea1dbbc7000f95faef6cf033f416c48cb07e
parent 2205741d
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -465,12 +465,15 @@ public final class BluetoothLeScanner {
                if (mScannerId > 0) {
                    mLeScanClients.put(mScanCallback, this);
                } else {
                    // Registration timed out or got exception, reset RscannerId to -1 so no
                    // Registration timed out or got exception, reset scannerId to -1 so no
                    // subsequent operations can proceed.
                    if (mScannerId == 0) mScannerId = -1;

                    // If scanning too frequently, don't report anything to the app.
                    if (mScannerId == -2) return;
                    if (mScannerId == -2) {
                        Log.e(TAG, "registration failed because app is scanning too frequently");
                        return;
                    }

                    postCallbackError(
                            mScanCallback,