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

Commit 6d6817d8 authored by Jakub Pawlowski's avatar Jakub Pawlowski
Browse files

Reduce logspam for background scans

Background scans would trigger logs on each scan result. In environments
with multiple advertisers, this is spamming the logcat output.

Change-Id: Id50a5143fc5d37e4954ce5b77c20926f3ca9ece7
parent 4024c5ee
Loading
Loading
Loading
Loading
+13 −5
Original line number Diff line number Diff line
@@ -1777,7 +1777,9 @@ public class GattService extends ProfileService {
        for (ScanClient client : mScanManager.getRegularScanQueue()) {
            ScannerMap.App app = mScannerMap.getById(client.scannerId);
            if (app == null) {
                Log.i(TAG, "App is null; skip.");
                if (VDBG) {
                    Log.d(TAG, "App is null; skip.");
                }
                continue;
            }

@@ -1789,7 +1791,9 @@ public class GattService extends ProfileService {
            if (settings.getLegacy()) {
                if ((eventType & ET_LEGACY_MASK) == 0) {
                    // If this is legacy scan, but nonlegacy result - skip.
                    Log.i(TAG, "Legacy scan, non legacy result; skip.");
                    if (VDBG) {
                        Log.d(TAG, "Legacy scan, non legacy result; skip.");
                    }
                    continue;
                } else {
                    // Some apps are used to fixed-size advertise data.
@@ -1830,8 +1834,10 @@ public class GattService extends ProfileService {
            }
            MatchResult matchResult = matchesFilters(client, result, originalAddress);
            if (!hasPermission || !matchResult.getMatches()) {
                Log.i(TAG, "Skipping client: permission="
                if (VDBG) {
                    Log.d(TAG, "Skipping client: permission="
                            + hasPermission + " matches=" + matchResult.getMatches());
                }
                continue;
            }

@@ -1843,7 +1849,9 @@ public class GattService extends ProfileService {
            }

            if ((settings.getCallbackType() & ScanSettings.CALLBACK_TYPE_ALL_MATCHES) == 0) {
                Log.i(TAG, "Skipping client: CALLBACK_TYPE_ALL_MATCHES");
                if (VDBG) {
                    Log.d(TAG, "Skipping client: CALLBACK_TYPE_ALL_MATCHES");
                }
                continue;
            }