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

Commit 58f2c252 authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "BLE: fix doesn't unregister client_if since appDied flag is wrong"

parents f6c0cf81 a01a9be4
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -340,25 +340,25 @@ public class GattService extends ProfileService {
                Log.d(TAG, "Binder is dead - unregistering scanner (" + mScannerId + ")!");
            }

            if (isScanClient(mScannerId)) {
                ScanClient client = new ScanClient(mScannerId);
            ScanClient client = getScanClient(mScannerId);
            if (client != null) {
                client.appDied = true;
                stopScan(client.scannerId);
            }
        }

        private boolean isScanClient(int clientIf) {
        private ScanClient getScanClient(int clientIf) {
            for (ScanClient client : mScanManager.getRegularScanQueue()) {
                if (client.scannerId == clientIf) {
                    return true;
                    return client;
                }
            }
            for (ScanClient client : mScanManager.getBatchScanQueue()) {
                if (client.scannerId == clientIf) {
                    return true;
                    return client;
                }
            }
            return false;
            return null;
        }
    }