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

Commit 9e0e2fb3 authored by Palash Ahuja's avatar Palash Ahuja
Browse files

[BluetoothMetrics] Adding Counter Metrics for AutoConnect=true/false

Bug: 279566653
Change-Id: I88b782187ff45329f618beb08139286cec87851e
parent 1f3cdb14
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -84,6 +84,7 @@ import com.android.bluetooth.Utils;
import com.android.bluetooth.btservice.AbstractionLayer;
import com.android.bluetooth.btservice.AdapterService;
import com.android.bluetooth.btservice.BluetoothAdapterProxy;
import com.android.bluetooth.btservice.MetricsLogger;
import com.android.bluetooth.btservice.CompanionManager;
import com.android.bluetooth.btservice.ProfileService;
import com.android.bluetooth.util.NumberUtils;
@@ -3641,6 +3642,11 @@ public class GattService extends ProfileService {
                    + opportunistic + ", phy=" + phy);
        }
        statsLogAppPackage(address, attributionSource.getUid(), clientIf);
        if (isDirect) {
          MetricsLogger.getInstance().count(BluetoothProtoEnums.GATT_CLIENT_CONNECT_IS_DIRECT, 1);
        } else {
          MetricsLogger.getInstance().count(BluetoothProtoEnums.GATT_CLIENT_CONNECT_IS_AUTOCONNECT, 1);
        }
        statsLogGattConnectionStateChange(
                BluetoothProfile.GATT, address, clientIf,
                BluetoothProtoEnums.CONNECTION_STATE_CONNECTING, -1);