Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ae6c8fac authored by Joanne Chung's avatar Joanne Chung Committed by Automerger Merge Worker
Browse files

Merge "Add package, activity count in allow list for ContentCapture logging"...

Merge "Add package, activity count in allow list for ContentCapture logging" into tm-dev am: 790afd00 am: 7e771703

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18367865



Change-Id: Ib99042050fa4a0139176ee9dfb7060d152238428
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 17503673 7e771703
Loading
Loading
Loading
Loading
+2 −3
Original line number Original line Diff line number Diff line
@@ -37,7 +37,7 @@ public final class ContentCaptureMetricsLogger {
    public static void writeServiceEvent(int eventType, @NonNull String serviceName) {
    public static void writeServiceEvent(int eventType, @NonNull String serviceName) {
        // we should not logging the application package name
        // we should not logging the application package name
        FrameworkStatsLog.write(FrameworkStatsLog.CONTENT_CAPTURE_SERVICE_EVENTS, eventType,
        FrameworkStatsLog.write(FrameworkStatsLog.CONTENT_CAPTURE_SERVICE_EVENTS, eventType,
                serviceName, /* componentName= */ null);
                serviceName, /* componentName= */ null, 0, 0);
    }
    }


    /** @hide */
    /** @hide */
@@ -49,14 +49,13 @@ public final class ContentCaptureMetricsLogger {
    public static void writeSetWhitelistEvent(@Nullable ComponentName service,
    public static void writeSetWhitelistEvent(@Nullable ComponentName service,
            @Nullable List<String> packages, @Nullable List<ComponentName> activities) {
            @Nullable List<String> packages, @Nullable List<ComponentName> activities) {
        final String serviceName = ComponentName.flattenToShortString(service);
        final String serviceName = ComponentName.flattenToShortString(service);
        // TODO: log allow list count.
        int packageCount = packages != null ? packages.size() : 0;
        int packageCount = packages != null ? packages.size() : 0;
        int activityCount = activities != null ? activities.size() : 0;
        int activityCount = activities != null ? activities.size() : 0;
        // we should not logging the application package name
        // we should not logging the application package name
        // log the allow list package and activity count instead
        // log the allow list package and activity count instead
        FrameworkStatsLog.write(FrameworkStatsLog.CONTENT_CAPTURE_SERVICE_EVENTS,
        FrameworkStatsLog.write(FrameworkStatsLog.CONTENT_CAPTURE_SERVICE_EVENTS,
                FrameworkStatsLog.CONTENT_CAPTURE_SERVICE_EVENTS__EVENT__SET_WHITELIST,
                FrameworkStatsLog.CONTENT_CAPTURE_SERVICE_EVENTS__EVENT__SET_WHITELIST,
                serviceName, /* allowListStr= */ null);
                serviceName, /* allowListStr= */ null, packageCount, activityCount);
    }
    }


    /** @hide */
    /** @hide */