diff --git a/services/credentials/java/com/android/server/credentials/MetricUtilities.java b/services/credentials/java/com/android/server/credentials/MetricUtilities.java index ed0c88709aff2..749d6b6246d0b 100644 --- a/services/credentials/java/com/android/server/credentials/MetricUtilities.java +++ b/services/credentials/java/com/android/server/credentials/MetricUtilities.java @@ -217,11 +217,12 @@ public class MetricUtilities { /* auth_per_entry_counts */ authenticationMetric.getAuthEntryCollective().getUniqueEntryCounts(), /* framework_exception_unique_classtype */ - DEFAULT_STRING, - /* exception_specified */ false, - /* auth_provider_status TODO(immediately) change */ DEFAULT_INT_32, + authenticationMetric.getFrameworkException(), + /* exception_specified */ authenticationMetric.isHasException(), + /* auth_provider_status */ + authenticationMetric.getProviderStatus(), /* query_returned */ - false + authenticationMetric.isQueryReturned() ); } catch (Exception e) { Slog.w(TAG, "Unexpected error during candidate get metric logging: " + e); diff --git a/services/credentials/java/com/android/server/credentials/ProviderGetSession.java b/services/credentials/java/com/android/server/credentials/ProviderGetSession.java index 51af25b589924..14260f0e1ad43 100644 --- a/services/credentials/java/com/android/server/credentials/ProviderGetSession.java +++ b/services/credentials/java/com/android/server/credentials/ProviderGetSession.java @@ -269,6 +269,7 @@ public final class ProviderGetSession extends ProviderSession entryCounts = new LinkedHashMap<>(); @@ -266,12 +300,10 @@ public class ProviderSessionMetric { if (!isAuthEntry) { mCandidatePhasePerProviderMetric.setResponseCollective(responseCollective); } else { - BrowsedAuthenticationMetric browsedAuthenticationMetric = - new BrowsedAuthenticationMetric(mCandidatePhasePerProviderMetric - .getSessionIdProvider()); - // to receive an auth entry, the candidate phase must have succeeded + // The most recent auth entry must be created already + var browsedAuthenticationMetric = + mBrowsedAuthenticationMetric.get(mBrowsedAuthenticationMetric.size() - 1); browsedAuthenticationMetric.setAuthEntryCollective(responseCollective); - mBrowsedAuthenticationMetric.add(browsedAuthenticationMetric); } } } diff --git a/services/credentials/java/com/android/server/credentials/metrics/RequestSessionMetric.java b/services/credentials/java/com/android/server/credentials/metrics/RequestSessionMetric.java index 4fb2d207b112b..009cfa852bf40 100644 --- a/services/credentials/java/com/android/server/credentials/metrics/RequestSessionMetric.java +++ b/services/credentials/java/com/android/server/credentials/metrics/RequestSessionMetric.java @@ -365,7 +365,9 @@ public class RequestSessionMetric { /** * This logs the authentication entry when browsed. Combined with the known browsed clicks * in the {@link ChosenProviderFinalPhaseMetric}, this fully captures the authentication entry - * logic for multiple loops. + * logic for multiple loops. An auth entry may have default or missing data, but if a provider + * was never assigned to an auth entry, this indicates an auth entry was never clicked. + * This case is handled in this emit. * * @param browsedAuthenticationMetric the authentication metric information to emit */