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

Commit e1146202 authored by Jakub Pawłowski's avatar Jakub Pawłowski Committed by Gerrit Code Review
Browse files

Merge "Bluetooth: remove suspended scan client when app calls stopScan"

parents cf6a4252 8715fd89
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -305,6 +305,9 @@ public class ScanManager {
        if (client == null) {
            client = mScanNative.getRegularScanClient(scannerId);
        }
        if (client == null) {
            client = mScanNative.getSuspendedScanClient(scannerId);
        }
        sendMessage(MSG_STOP_BLE_SCAN, client);
    }

@@ -1273,6 +1276,15 @@ public class ScanManager {
            return null;
        }

        ScanClient getSuspendedScanClient(int scannerId) {
            for (ScanClient client : mSuspendedScanClients) {
                if (client.scannerId == scannerId) {
                    return client;
                }
            }
            return null;
        }

        void stopBatchScan(ScanClient client) {
            mBatchClients.remove(client);
            removeScanFilters(client.scannerId);