Fixed AUTOFILL_SERVICE_DISABLED_APP and AUTOFILL_SERVICE_DISABLED_ACTIVITY.
These metric were using the RESERVED_FOR_LOGBUILDER_COUNTER and hence were not
being picked up.
Bug: 71863561
Test: adb shell logcat -b events | grep sysui | egrep '(1231|1232)'
Change-Id: I34136ac3423e819b37fc3c14c1821171af1868d9
diff --git a/proto/src/metrics_constants.proto b/proto/src/metrics_constants.proto
index bfec88c..699231f 100644
--- a/proto/src/metrics_constants.proto
+++ b/proto/src/metrics_constants.proto
@@ -4872,17 +4872,17 @@
// An autofill service asked to disable autofill for a given application.
// Package: Package of app that is being disabled for autofill
- // Counter: duration (in ms) that autofill will be disabled
// OS: P
// Tag FIELD_AUTOFILL_SERVICE: Package of service that processed the request
+ // Tag FIELD_AUTOFILL_DURATION: duration (in ms) that autofill will be disabled
AUTOFILL_SERVICE_DISABLED_APP = 1231;
// An autofill service asked to disable autofill for a given activity.
// Package: Package of app whose activity is being disabled for autofill
- // Counter: duration (in ms) that autofill will be disabled
// OS: P
// Tag FIELD_AUTOFILL_SERVICE: Package of service that processed the request
// Tag FIELD_CLASS_NAME: Class name of the activity that is being disabled for autofill
+ // Tag FIELD_AUTOFILL_DURATION: duration (in ms) that autofill will be disabled
AUTOFILL_SERVICE_DISABLED_ACTIVITY = 1232;
// ACTION: Stop an app and turn on background check
diff --git a/services/autofill/java/com/android/server/autofill/AutofillManagerServiceImpl.java b/services/autofill/java/com/android/server/autofill/AutofillManagerServiceImpl.java
index 07b0b77..eb031f3 100644
--- a/services/autofill/java/com/android/server/autofill/AutofillManagerServiceImpl.java
+++ b/services/autofill/java/com/android/server/autofill/AutofillManagerServiceImpl.java
@@ -1066,7 +1066,7 @@
int intDuration = duration > Integer.MAX_VALUE ? Integer.MAX_VALUE : (int) duration;
mMetricsLogger.write(Helper.newLogMaker(MetricsEvent.AUTOFILL_SERVICE_DISABLED_APP,
packageName, getServicePackageName())
- .setCounterValue(intDuration));
+ .addTaggedData(MetricsEvent.FIELD_AUTOFILL_DURATION, intDuration));
}
}
@@ -1090,7 +1090,7 @@
mMetricsLogger.write(new LogMaker(MetricsEvent.AUTOFILL_SERVICE_DISABLED_ACTIVITY)
.setComponentName(componentName)
.addTaggedData(MetricsEvent.FIELD_AUTOFILL_SERVICE, getServicePackageName())
- .setCounterValue(intDuration));
+ .addTaggedData(MetricsEvent.FIELD_AUTOFILL_DURATION, intDuration));
}
}