From 5b9fe2f235d0af17bc29c1a1e7909610ef399e03 Mon Sep 17 00:00:00 2001 From: Joanne Chung Date: Fri, 13 May 2022 13:10:51 +0800 Subject: [PATCH] Add package, activity count in allow list for ContentCapture logging Bug: 231634467 Test: manual. build pass and local log the count. Change-Id: Id4076b60df60426e50cf90132880e67a2b09d70a --- .../server/contentcapture/ContentCaptureMetricsLogger.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java b/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java index db3db4ec01494..10bec64936b38 100644 --- a/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java +++ b/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java @@ -37,7 +37,7 @@ public final class ContentCaptureMetricsLogger { public static void writeServiceEvent(int eventType, @NonNull String serviceName) { // we should not logging the application package name FrameworkStatsLog.write(FrameworkStatsLog.CONTENT_CAPTURE_SERVICE_EVENTS, eventType, - serviceName, /* componentName= */ null); + serviceName, /* componentName= */ null, 0, 0); } /** @hide */ @@ -49,14 +49,13 @@ public final class ContentCaptureMetricsLogger { public static void writeSetWhitelistEvent(@Nullable ComponentName service, @Nullable List packages, @Nullable List activities) { final String serviceName = ComponentName.flattenToShortString(service); - // TODO: log allow list count. int packageCount = packages != null ? packages.size() : 0; int activityCount = activities != null ? activities.size() : 0; // we should not logging the application package name // log the allow list package and activity count instead FrameworkStatsLog.write(FrameworkStatsLog.CONTENT_CAPTURE_SERVICE_EVENTS, FrameworkStatsLog.CONTENT_CAPTURE_SERVICE_EVENTS__EVENT__SET_WHITELIST, - serviceName, /* allowListStr= */ null); + serviceName, /* allowListStr= */ null, packageCount, activityCount); } /** @hide */