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

Commit be3d2e72 authored by Kihong Seong's avatar Kihong Seong Committed by Automerger Merge Worker
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 am: aa34c3ef

Original change: https://android-review.googlesource.com/c/platform/packages/modules/Bluetooth/+/2682610



Change-Id: I87cc1b0cd046f384ae9b02e1ca82eb9464fcdec1
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents d517102f aa34c3ef
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);
    }