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

Commit 8715fd89 authored by dongguanjun1's avatar dongguanjun1 Committed by 董冠军
Browse files

Bluetooth: remove suspended scan client when app calls stopScan



The ble scan is resumed even though the scan owner had called stopScan().

Tag: #bugfix
Bug: 252637444
Test: manual
Signed-off-by: default avatardongguanjun1 <dongguanjun1@xiaomi.com>
Change-Id: Ic2a025059b9b84be158eb2a29f19bb377850798f
parent d904e899
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -282,6 +282,9 @@ public class ScanManager {
        if (client == null) {
            client = mScanNative.getRegularScanClient(scannerId);
        }
        if (client == null) {
            client = mScanNative.getSuspendedScanClient(scannerId);
        }
        sendMessage(MSG_STOP_BLE_SCAN, client);
    }

@@ -1127,6 +1130,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);