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

Commit d1d46061 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "Bluetooth: Prevent scan start if already in progress"

parents 8e23d5c3 addf36e8
Loading
Loading
Loading
Loading
+16 −2
Original line number Diff line number Diff line
@@ -904,8 +904,15 @@ public class GattService extends ProfileService {
            LeScanRequestArbitrator.instance().RequestLeScan(LeScanRequestArbitrator.LE_NORMAL_SCAN_TYPE)) {
            if (DBG) Log.d(TAG, "startScan() - adding client=" + appIf);
            mScanQueue.add(new ScanClient(appIf, isServer));
            if(mScanQueue.size()==1)//start scan only if it is not already started
            {
                gattClientScanNative(appIf, true);
            }
            else
            {
                Log.d(TAG, "startScan scan already in progress for appifs-queue=" + mScanQueue.size());
            }
        }
    }

    void startScanWithUuids(int appIf, boolean isServer, UUID[] uuids) {
@@ -917,8 +924,15 @@ public class GattService extends ProfileService {
            LeScanRequestArbitrator.instance().RequestLeScan(LeScanRequestArbitrator.LE_NORMAL_SCAN_TYPE)) {
            if (DBG) Log.d(TAG, "startScanWithUuids() - adding client=" + appIf);
            mScanQueue.add(new ScanClient(appIf, isServer, uuids));
            if(mScanQueue.size()==1)//start scan only if it is not already started
            {
                gattClientScanNative(appIf, true);
            }
            else
            {
                Log.d(TAG, "startScanWithUuids scan already in progress for appifs-queue=" + mScanQueue.size());
            }
        }
    }

    void stopScan(int appIf, boolean isServer) {