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

Commit aa34c3ef authored by Kihong Seong's avatar Kihong Seong Committed by Gerrit Code Review
Browse files

Merge "[BluetoothMetrics] Adding Counter Metrics for running in foreground...

Merge "[BluetoothMetrics] Adding Counter Metrics for running in foreground when performing server connect" into main
parents 2ec5fe33 454274c6
Loading
Loading
Loading
Loading
+22 −0
Original line number Diff line number Diff line
@@ -4561,6 +4561,28 @@ public class GattService extends ProfileService {
        if (DBG) {
            Log.d(TAG, "serverConnect() - address=" + address);
        }

        int importance = mActivityManager.getUidImportance(attributionSource.getUid());
        if (importance == IMPORTANCE_FOREGROUND_SERVICE) {
            MetricsLogger.getInstance()
                    .count(
                            isDirect
                                    ? BluetoothProtoEnums
                                            .GATT_SERVER_CONNECT_IS_DIRECT_IN_FOREGROUND
                                    : BluetoothProtoEnums
                                            .GATT_SERVER_CONNECT_IS_AUTOCONNECT_IN_FOREGROUND,
                            1);
        } else {
            MetricsLogger.getInstance()
                    .count(
                            isDirect
                                    ? BluetoothProtoEnums
                                            .GATT_SERVER_CONNECT_IS_DIRECT_NOT_IN_FOREGROUND
                                    : BluetoothProtoEnums
                                            .GATT_SERVER_CONNECT_IS_AUTOCONNECT_NOT_IN_FOREGROUND,
                            1);
        }

        mNativeInterface.gattServerConnect(serverIf, address, isDirect, transport);
    }