summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Arpan Kaphle <akaphle@google.com> 2023-05-04 03:08:03 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2023-05-04 03:08:03 +0000
commita1e3db27efef631664863da5921c75e3fb52b730 (patch)
tree128ff0b159d47621a46ead1d95453c70a4df86b9
parente597433f25ffabc264313aee1f7034a0e5279dcf (diff)
parent3d0d25996f430675ba6eb93acf593596ae6e43bd (diff)
Merge "Adding in New Status Emit for isEnabled" into udc-dev
-rw-r--r--services/credentials/java/com/android/server/credentials/CredentialManagerService.java5
-rw-r--r--services/credentials/java/com/android/server/credentials/MetricUtilities.java26
2 files changed, 9 insertions, 22 deletions
diff --git a/services/credentials/java/com/android/server/credentials/CredentialManagerService.java b/services/credentials/java/com/android/server/credentials/CredentialManagerService.java
index 7f95e058406e..dd180d0ae4e4 100644
--- a/services/credentials/java/com/android/server/credentials/CredentialManagerService.java
+++ b/services/credentials/java/com/android/server/credentials/CredentialManagerService.java
@@ -748,7 +748,7 @@ public final class CredentialManagerService
if (serviceComponentName.equals(componentName)) {
if (!s.getServicePackageName().equals(callingPackage)) {
// The component name and the package name do not match.
- MetricUtilities.logApiCalledSimpleV1(
+ MetricUtilities.logApiCalledSimpleV2(
ApiName.IS_ENABLED_CREDENTIAL_PROVIDER_SERVICE,
ApiStatus.FAILURE, callingUid);
Slog.w(
@@ -757,10 +757,9 @@ public final class CredentialManagerService
+ "not match package name.");
return false;
}
- MetricUtilities.logApiCalledSimpleV1(
+ MetricUtilities.logApiCalledSimpleV2(
ApiName.IS_ENABLED_CREDENTIAL_PROVIDER_SERVICE,
ApiStatus.SUCCESS, callingUid);
- // TODO(b/271135048) - Update asap to use the new logging types
return true;
}
}
diff --git a/services/credentials/java/com/android/server/credentials/MetricUtilities.java b/services/credentials/java/com/android/server/credentials/MetricUtilities.java
index 47502c24fbd7..e4c6b3a10dd8 100644
--- a/services/credentials/java/com/android/server/credentials/MetricUtilities.java
+++ b/services/credentials/java/com/android/server/credentials/MetricUtilities.java
@@ -266,7 +266,9 @@ public class MetricUtilities {
/* request_unique_classtypes */
initialPhaseMetric.getUniqueRequestStrings(),
/* per_classtype_counts */
- initialPhaseMetric.getUniqueRequestCounts()
+ initialPhaseMetric.getUniqueRequestCounts(),
+ /* api_name */
+ initialPhaseMetric.getApiName()
);
} catch (Exception e) {
Slog.w(TAG, "Unexpected error during candidate provider uid metric emit: " + e);
@@ -274,36 +276,22 @@ public class MetricUtilities {
}
/**
- * This is useful just to record an API calls' final event, and for no other purpose. It will
- * contain default values for all other optional parameters.
- *
- * TODO(b/271135048) - given space requirements, this may be a good candidate for another atom
- * TODO immediately remove and carry over TODO to new log for this setup
+ * This is useful just to record an API calls' final event, and for no other purpose.
*
* @param apiName the api name to log
* @param apiStatus the status to log
* @param callingUid the calling uid
*/
- public static void logApiCalledSimpleV1(ApiName apiName, ApiStatus apiStatus,
+ public static void logApiCalledSimpleV2(ApiName apiName, ApiStatus apiStatus,
int callingUid) {
try {
if (!LOG_FLAG) {
return;
}
- FrameworkStatsLog.write(FrameworkStatsLog.CREDENTIAL_MANAGER_API_CALLED,
+ FrameworkStatsLog.write(FrameworkStatsLog.CREDENTIAL_MANAGER_APIV2_CALLED,
/* api_name */apiName.getMetricCode(),
/* caller_uid */ callingUid,
- /* api_status */ apiStatus.getMetricCode(),
- /* repeated_candidate_provider_uid */ DEFAULT_REPEATED_INT_32,
- /* repeated_candidate_provider_round_trip_time_query_microseconds */
- DEFAULT_REPEATED_INT_32,
- /* repeated_candidate_provider_status */ DEFAULT_REPEATED_INT_32,
- /* chosen_provider_uid */ DEFAULT_INT_32,
- /* chosen_provider_round_trip_time_overall_microseconds */
- DEFAULT_INT_32,
- /* chosen_provider_final_phase_microseconds */
- DEFAULT_INT_32,
- /* chosen_provider_status */ DEFAULT_INT_32);
+ /* api_status */ apiStatus.getMetricCode());
} catch (Exception e) {
Slog.w(TAG, "Unexpected error during metric logging: " + e);
}