From 2568de06640518210f3bc4df479474ddc95e82b7 Mon Sep 17 00:00:00 2001 From: Felipe Leme Date: Wed, 21 Mar 2018 08:52:14 -0700 Subject: [PATCH] Set FIELD_AUTOFILL_NUM_DATASETS to -1 when service return no response. Test: adb shell logcat -b events | grep sysui | grep '757,907' # while running LoginActivityTest#testAutoFillNoDatasets Bug: 70241978 Change-Id: I611bd4fa8407b16491f1ae7b859564233fa6ba81 --- proto/src/metrics_constants.proto | 3 ++- .../autofill/java/com/android/server/autofill/Session.java | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/proto/src/metrics_constants.proto b/proto/src/metrics_constants.proto index 0cc60e3146d78..b3ec8d022d080 100644 --- a/proto/src/metrics_constants.proto +++ b/proto/src/metrics_constants.proto @@ -3964,7 +3964,8 @@ message MetricsEvent { // Type TYPE_FAILURE: The request failed // Package: Package of app that is autofilled // Tag FIELD_AUTOFILL_SERVICE: Package of service that processed the request - // Tag FIELD_AUTOFILL_NUM_DATASETS: The number of datasets returned (only in success case) + // Tag FIELD_AUTOFILL_NUM_DATASETS: The number of datasets returned in the response, or -1 if + // the service returned a null response. // NOTE: starting on OS P, it also added: // Type TYPE_CLOSE: Service returned a null response. // Tag FIELD_AUTOFILL_NUM_FIELD_CLASSIFICATION_IDS: if service requested field classification, diff --git a/services/autofill/java/com/android/server/autofill/Session.java b/services/autofill/java/com/android/server/autofill/Session.java index 7f57615163022..55c0372dc3a03 100644 --- a/services/autofill/java/com/android/server/autofill/Session.java +++ b/services/autofill/java/com/android/server/autofill/Session.java @@ -596,6 +596,9 @@ final class Session implements RemoteFillService.FillServiceCallbacks, ViewState } if (response == null) { processNullResponseLocked(requestFlags); + mMetricsLogger.write(newLogMaker(MetricsEvent.AUTOFILL_REQUEST, servicePackageName) + .setType(MetricsEvent.TYPE_SUCCESS) + .addTaggedData(MetricsEvent.FIELD_AUTOFILL_NUM_DATASETS, -1)); return; }