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

Commit b0a554c5 authored by weichinweng's avatar weichinweng Committed by android-build-merger
Browse files

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

Merge "BLE: fix doesn't unregister client_if since appDied flag is wrong" am: a94c26a8 am: c95b44ce
am: adc75147

Change-Id: I2d2ee33fb07af01ae7d239f657b9fa9e0e0591bb
parents 06ce8359 adc75147
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;
        }
    }