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

Commit cf44b90b authored by Wei Wang's avatar Wei Wang
Browse files

Workaround to fix Bluetooth crash when using onFound/onLost.

Bug:20694614
Change-Id: I87b9f58af53551f7b919e6db76ada516eac33176
parent 6ba53bde
Loading
Loading
Loading
Loading
+11 −1
Original line number Diff line number Diff line
@@ -598,7 +598,8 @@ public class ScanManager {

        void stopRegularScan(ScanClient client) {
            // Remove scan filters and recycle filter indices.
            removeScanFilters(client.clientIf);
            client = getClient(client.clientIf);
            if (client == null) return;
            int deliveryMode = getDeliveryMode(client);
            if (deliveryMode == DELIVERY_MODE_ON_FOUND_LOST) {
                for (ScanFilter filter : client.filters) {
@@ -620,6 +621,15 @@ public class ScanManager {
                logd("stop scan");
                gattClientScanNative(false);
            }
            removeScanFilters(client.clientIf);
        }

        // Find the scan client information
        ScanClient getClient(int clientIf) {
            for (ScanClient client : mRegularScanClients) {
              if (client.clientIf == clientIf) return client;
            }
            return null;
        }

        void stopBatchScan(ScanClient client) {