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

Commit 77954c80 authored by Ajay Panicker's avatar Ajay Panicker
Browse files

Prevent opportunistic scans from changing the hardware filter

Before this patch opportunistic scans could set the hardware filter
to be an all pass filter. This would result large amounts of scan
results as short filtered scans would act as if they were unfiltered.
Now if an app is scanning opportunistically, its filter doesn't
get added to the hardware filter.

Fixes: 62280037
Test: Do a filtered scan while another app is scanning opportunistically
      and see that the scan results only increase marginally.

Change-Id: I6214a2dd14d2c5ee4c21faa440c48ce7bab0b3fe
(cherry picked from commit b5d5a9563793d32bdafacfe93e303a13d5afd364)
parent 8048af5d
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -685,6 +685,7 @@ public class ScanManager {
                Log.w(TAG,
                        "Moving scan client to opportunistic (scannerId " + client.scannerId + ")");
                setOpportunisticScanClient(client);
                removeScanFilters(client.scannerId);
                client.stats.setScanTimeout();
            }

@@ -769,6 +770,12 @@ public class ScanManager {
            int scannerId = client.scannerId;
            int deliveryMode = getDeliveryMode(client);
            int trackEntries = 0;

            // Do not add any filters set by opportunistic scan clients
            if (isOpportunisticScanClient(client)) {
                return;
            }

            if (!shouldAddAllPassFilterToController(client, deliveryMode)) {
                return;
            }