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

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

Merge "BLE: Don't start scan if the same Pi scan is running."

am: bec5b1c5

Change-Id: If56e2af15bb66b10279df1a6810231a70f16b5cc
parents 5974f6fe bec5b1c5
Loading
Loading
Loading
Loading
+7 −0
Original line number Original line Diff line number Diff line
@@ -1989,6 +1989,13 @@ public class GattService extends ProfileService {
        piInfo.settings = settings;
        piInfo.settings = settings;
        piInfo.filters = filters;
        piInfo.filters = filters;
        piInfo.callingPackage = callingPackage;
        piInfo.callingPackage = callingPackage;

        // Don't start scan if the Pi scan already in mScannerMap.
        if (mScannerMap.getByContextInfo(piInfo) != null) {
            Log.d(TAG, "Don't startScan(PI) since the same Pi scan already in mScannerMap.");
            return;
        }

        ScannerMap.App app = mScannerMap.add(uuid, null, null, piInfo, this);
        ScannerMap.App app = mScannerMap.add(uuid, null, null, piInfo, this);
        app.mUserHandle = UserHandle.of(UserHandle.getCallingUserId());
        app.mUserHandle = UserHandle.of(UserHandle.getCallingUserId());
        mAppOps.checkPackage(Binder.getCallingUid(), callingPackage);
        mAppOps.checkPackage(Binder.getCallingUid(), callingPackage);