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

Commit 10311829 authored by Ajay Panicker's avatar Ajay Panicker Committed by android-build-merger
Browse files

Merge "Add GATT server scan stats and extra protection" am: 4e8da47e

am: 25f233eb

* commit '25f233eb':
  Add GATT server scan stats and extra protection

Change-Id: Ida1ee11b2e57e38c3bd097c57b045bd30c3a5f23
parents e9fbe54e 25f233eb
Loading
Loading
Loading
Loading
+18 −2
Original line number Diff line number Diff line
@@ -1302,7 +1302,15 @@ public class GattService extends ProfileService {
        scanClient.hasPeersMacAddressPermission = Utils.checkCallerHasPeersMacAddressPermission(
                this);
        scanClient.legacyForegroundApp = Utils.isLegacyForegroundApp(this, callingPackage);
        mClientMap.getAppScanStatsById(appIf).recordScanStart(settings);

        AppScanStats app = null;
        if (isServer) {
            app = mServerMap.getAppScanStatsById(appIf);
        } else {
            app = mClientMap.getAppScanStatsById(appIf);
        }
        if (app != null) app.recordScanStart(settings);

        mScanManager.startScan(scanClient);
    }

@@ -1317,7 +1325,15 @@ public class GattService extends ProfileService {
        int scanQueueSize = mScanManager.getBatchScanQueue().size() +
                mScanManager.getRegularScanQueue().size();
        if (DBG) Log.d(TAG, "stopScan() - queue size =" + scanQueueSize);
        mClientMap.getAppScanStatsById(client.clientIf).recordScanStop();

        AppScanStats app = null;
        if (client.isServer) {
            app = mServerMap.getAppScanStatsById(client.clientIf);
        } else {
            app = mClientMap.getAppScanStatsById(client.clientIf);
        }
        if (app != null) app.recordScanStop();

        mScanManager.stopScan(client);
    }