Loading services/credentials/java/com/android/server/credentials/MetricUtilities.java +15 −7 Original line number Diff line number Diff line Loading @@ -178,9 +178,11 @@ public class MetricUtilities { * * @param providers a map with known providers and their held metric objects * @param emitSequenceId an emitted sequence id for the current session * @param initialPhaseMetric contains initial phase data to avoid repetition for candidate * phase, track 2, logging */ public static void logApiCalledCandidatePhase(Map<String, ProviderSession> providers, int emitSequenceId) { int emitSequenceId, InitialPhaseMetric initialPhaseMetric) { try { if (!LOG_FLAG) { return; Loading @@ -200,6 +202,7 @@ public class MetricUtilities { int[] candidateActionEntryCountList = new int[providerSize]; int[] candidateAuthEntryCountList = new int[providerSize]; int[] candidateRemoteEntryCountList = new int[providerSize]; String[] frameworkExceptionList = new String[providerSize]; int index = 0; for (var session : providerSessions) { CandidatePhaseMetric metric = session.mProviderSessionMetric Loading @@ -225,7 +228,7 @@ public class MetricUtilities { candidateActionEntryCountList[index] = metric.getActionEntryCount(); candidateAuthEntryCountList[index] = metric.getAuthenticationEntryCount(); candidateRemoteEntryCountList[index] = metric.getRemoteEntryCount(); // frameworkExceptionList[index] = metric.getFrameworkException(); frameworkExceptionList[index] = metric.getFrameworkException(); index++; } FrameworkStatsLog.write(FrameworkStatsLog.CREDENTIAL_MANAGER_CANDIDATE_PHASE_REPORTED, Loading @@ -246,11 +249,16 @@ public class MetricUtilities { /* candidate_provider_credential_entry_type_count */ candidateCredentialTypeCountList, /* candidate_provider_remote_entry_count */ candidateRemoteEntryCountList, /* candidate_provider_authentication_entry_count */ candidateAuthEntryCountList, DEFAULT_REPEATED_STR, false, DEFAULT_REPEATED_STR, DEFAULT_REPEATED_INT_32 /* candidate_provider_authentication_entry_count */ candidateAuthEntryCountList, /* framework_exception_per_provider */ frameworkExceptionList, /* origin_specified originSpecified */ initialPhaseMetric.isOriginSpecified(), /* request_unique_classtypes */ initialPhaseMetric.getUniqueRequestStrings(), /* per_classtype_counts */ initialPhaseMetric.getUniqueRequestCounts() ); } catch (Exception e) { Log.w(TAG, "Unexpected error during metric logging: " + e); Loading services/credentials/java/com/android/server/credentials/ProviderClearSession.java +2 −0 Original line number Diff line number Diff line Loading @@ -91,6 +91,8 @@ public final class ProviderClearSession extends ProviderSession<ClearCredentialS public void onProviderResponseFailure(int errorCode, Exception exception) { if (exception instanceof ClearCredentialStateException) { mProviderException = (ClearCredentialStateException) exception; // TODO(b/271135048) : Decide on exception type length mProviderSessionMetric.collectCandidateFrameworkException(mProviderException.getType()); } mProviderSessionMetric.collectCandidateExceptionStatus(/*hasException=*/true); updateStatusAndInvokeCallback(toStatus(errorCode), Loading services/credentials/java/com/android/server/credentials/ProviderCreateSession.java +2 −0 Original line number Diff line number Diff line Loading @@ -155,6 +155,8 @@ public final class ProviderCreateSession extends ProviderSession< if (exception instanceof CreateCredentialException) { // Store query phase exception for aggregation with final response mProviderException = (CreateCredentialException) exception; // TODO(b/271135048) : Decide on exception type length mProviderSessionMetric.collectCandidateFrameworkException(mProviderException.getType()); } mProviderSessionMetric.collectCandidateExceptionStatus(/*hasException=*/true); updateStatusAndInvokeCallback(toStatus(errorCode), Loading services/credentials/java/com/android/server/credentials/ProviderGetSession.java +2 −0 Original line number Diff line number Diff line Loading @@ -217,6 +217,8 @@ public final class ProviderGetSession extends ProviderSession<BeginGetCredential public void onProviderResponseFailure(int errorCode, Exception exception) { if (exception instanceof GetCredentialException) { mProviderException = (GetCredentialException) exception; // TODO(b/271135048) : Decide on exception type length mProviderSessionMetric.collectCandidateFrameworkException(mProviderException.getType()); } mProviderSessionMetric.collectCandidateExceptionStatus(/*hasException=*/true); updateStatusAndInvokeCallback(toStatus(errorCode), Loading services/credentials/java/com/android/server/credentials/metrics/ApiName.java +2 −2 Original line number Diff line number Diff line Loading @@ -57,7 +57,7 @@ CREDENTIAL_MANAGER_INITIAL_PHASE_REPORTED__API_NAME__API_NAME_IS_ENABLED_CREDENT ); ApiName(int innerMetricCode) { this.mInnerMetricCode = innerMetricCode; mInnerMetricCode = innerMetricCode; } /** Loading @@ -66,7 +66,7 @@ CREDENTIAL_MANAGER_INITIAL_PHASE_REPORTED__API_NAME__API_NAME_IS_ENABLED_CREDENT * @return a code corresponding to the west world metric name */ public int getMetricCode() { return this.mInnerMetricCode; return mInnerMetricCode; } /** Loading Loading
services/credentials/java/com/android/server/credentials/MetricUtilities.java +15 −7 Original line number Diff line number Diff line Loading @@ -178,9 +178,11 @@ public class MetricUtilities { * * @param providers a map with known providers and their held metric objects * @param emitSequenceId an emitted sequence id for the current session * @param initialPhaseMetric contains initial phase data to avoid repetition for candidate * phase, track 2, logging */ public static void logApiCalledCandidatePhase(Map<String, ProviderSession> providers, int emitSequenceId) { int emitSequenceId, InitialPhaseMetric initialPhaseMetric) { try { if (!LOG_FLAG) { return; Loading @@ -200,6 +202,7 @@ public class MetricUtilities { int[] candidateActionEntryCountList = new int[providerSize]; int[] candidateAuthEntryCountList = new int[providerSize]; int[] candidateRemoteEntryCountList = new int[providerSize]; String[] frameworkExceptionList = new String[providerSize]; int index = 0; for (var session : providerSessions) { CandidatePhaseMetric metric = session.mProviderSessionMetric Loading @@ -225,7 +228,7 @@ public class MetricUtilities { candidateActionEntryCountList[index] = metric.getActionEntryCount(); candidateAuthEntryCountList[index] = metric.getAuthenticationEntryCount(); candidateRemoteEntryCountList[index] = metric.getRemoteEntryCount(); // frameworkExceptionList[index] = metric.getFrameworkException(); frameworkExceptionList[index] = metric.getFrameworkException(); index++; } FrameworkStatsLog.write(FrameworkStatsLog.CREDENTIAL_MANAGER_CANDIDATE_PHASE_REPORTED, Loading @@ -246,11 +249,16 @@ public class MetricUtilities { /* candidate_provider_credential_entry_type_count */ candidateCredentialTypeCountList, /* candidate_provider_remote_entry_count */ candidateRemoteEntryCountList, /* candidate_provider_authentication_entry_count */ candidateAuthEntryCountList, DEFAULT_REPEATED_STR, false, DEFAULT_REPEATED_STR, DEFAULT_REPEATED_INT_32 /* candidate_provider_authentication_entry_count */ candidateAuthEntryCountList, /* framework_exception_per_provider */ frameworkExceptionList, /* origin_specified originSpecified */ initialPhaseMetric.isOriginSpecified(), /* request_unique_classtypes */ initialPhaseMetric.getUniqueRequestStrings(), /* per_classtype_counts */ initialPhaseMetric.getUniqueRequestCounts() ); } catch (Exception e) { Log.w(TAG, "Unexpected error during metric logging: " + e); Loading
services/credentials/java/com/android/server/credentials/ProviderClearSession.java +2 −0 Original line number Diff line number Diff line Loading @@ -91,6 +91,8 @@ public final class ProviderClearSession extends ProviderSession<ClearCredentialS public void onProviderResponseFailure(int errorCode, Exception exception) { if (exception instanceof ClearCredentialStateException) { mProviderException = (ClearCredentialStateException) exception; // TODO(b/271135048) : Decide on exception type length mProviderSessionMetric.collectCandidateFrameworkException(mProviderException.getType()); } mProviderSessionMetric.collectCandidateExceptionStatus(/*hasException=*/true); updateStatusAndInvokeCallback(toStatus(errorCode), Loading
services/credentials/java/com/android/server/credentials/ProviderCreateSession.java +2 −0 Original line number Diff line number Diff line Loading @@ -155,6 +155,8 @@ public final class ProviderCreateSession extends ProviderSession< if (exception instanceof CreateCredentialException) { // Store query phase exception for aggregation with final response mProviderException = (CreateCredentialException) exception; // TODO(b/271135048) : Decide on exception type length mProviderSessionMetric.collectCandidateFrameworkException(mProviderException.getType()); } mProviderSessionMetric.collectCandidateExceptionStatus(/*hasException=*/true); updateStatusAndInvokeCallback(toStatus(errorCode), Loading
services/credentials/java/com/android/server/credentials/ProviderGetSession.java +2 −0 Original line number Diff line number Diff line Loading @@ -217,6 +217,8 @@ public final class ProviderGetSession extends ProviderSession<BeginGetCredential public void onProviderResponseFailure(int errorCode, Exception exception) { if (exception instanceof GetCredentialException) { mProviderException = (GetCredentialException) exception; // TODO(b/271135048) : Decide on exception type length mProviderSessionMetric.collectCandidateFrameworkException(mProviderException.getType()); } mProviderSessionMetric.collectCandidateExceptionStatus(/*hasException=*/true); updateStatusAndInvokeCallback(toStatus(errorCode), Loading
services/credentials/java/com/android/server/credentials/metrics/ApiName.java +2 −2 Original line number Diff line number Diff line Loading @@ -57,7 +57,7 @@ CREDENTIAL_MANAGER_INITIAL_PHASE_REPORTED__API_NAME__API_NAME_IS_ENABLED_CREDENT ); ApiName(int innerMetricCode) { this.mInnerMetricCode = innerMetricCode; mInnerMetricCode = innerMetricCode; } /** Loading @@ -66,7 +66,7 @@ CREDENTIAL_MANAGER_INITIAL_PHASE_REPORTED__API_NAME__API_NAME_IS_ENABLED_CREDENT * @return a code corresponding to the west world metric name */ public int getMetricCode() { return this.mInnerMetricCode; return mInnerMetricCode; } /** Loading