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

Commit e4c8e891 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

am: 10311829

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

Change-Id: I0ff6ea72e4b115993f7832969b4affa9f4861575
parents e38bf479 10311829
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);
    }