Added more metrics for Autofill:
- AUTOFILL_VALUE_RESET
- FIELD_AUTOFILL_PREVIOUS_LENGTH
- AUTOFILL_DATASET_AUTHENTICATED
- AUTOFILL_INVALID_DATASET_AUTHENTICATION
- AUTOFILL_INVALID_AUTHENTICATION
- FIELD_AUTOFILL_SAVE_TYPE
- AUTOFILL_SAVE_CUSTOM_DESCRIPTION
- AUTOFILL_SAVE_CUSTOM_SUBTITLE
- AUTOFILL_SAVE_LINK_TAPPED
- AUTOFILL_SAVE_VALIDATION
- AUTOFILL_PENDING_SAVE_UI_OPERATION
Also tagged all metrics with FIELD_AUTOFILL_SERVICE, and added missing
package name on AUTOFILL_DATASET_APPLIED.
Test: CtsAutoFillServiceTestCases pass
Bug: 65118073
Bug: 65376559
Bug: 65697068
Change-Id: I678193c99d9d1b2dac56a62a88dcf20043d1b401
diff --git a/core/java/android/view/autofill/AutofillManager.java b/core/java/android/view/autofill/AutofillManager.java
index 61cbce9..27eeb2e 100644
--- a/core/java/android/view/autofill/AutofillManager.java
+++ b/core/java/android/view/autofill/AutofillManager.java
@@ -44,7 +44,7 @@
import com.android.internal.annotations.GuardedBy;
import com.android.internal.logging.MetricsLogger;
-import com.android.internal.logging.nano.MetricsProto;
+import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import java.io.PrintWriter;
import java.lang.annotation.Retention;
@@ -1245,10 +1245,10 @@
}
}
- final LogMaker log = new LogMaker(MetricsProto.MetricsEvent.AUTOFILL_DATASET_APPLIED);
- log.addTaggedData(MetricsProto.MetricsEvent.FIELD_AUTOFILL_NUM_VALUES, itemCount);
- log.addTaggedData(MetricsProto.MetricsEvent.FIELD_AUTOFILL_NUM_VIEWS_FILLED,
- numApplied);
+ final LogMaker log = new LogMaker(MetricsEvent.AUTOFILL_DATASET_APPLIED)
+ .setPackageName(mContext.getPackageName())
+ .addTaggedData(MetricsEvent.FIELD_AUTOFILL_NUM_VALUES, itemCount)
+ .addTaggedData(MetricsEvent.FIELD_AUTOFILL_NUM_VIEWS_FILLED, numApplied);
mMetricsLogger.write(log);
}
}