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

Commit 217f93a1 authored by Chris Wren's avatar Chris Wren Committed by Android (Google) Code Review
Browse files

Merge "Add optional package context to sysui action metrics."

parents 994349c6 3db024af
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -4,6 +4,6 @@ option java_package com.android.internal.logging;

# interaction logs
524287 sysui_view_visibility (category|1|5),(visible|1|6)
524288 sysui_action (category|1|5)
524288 sysui_action (category|1|5),(pkg|3)
524290 sysui_count (name|3),(increment|1)
524291 sysui_histogram (name|3),(bucket|1)
+6 −1
Original line number Diff line number Diff line
@@ -30,6 +30,7 @@ public class MetricsLogger implements MetricsConstants {

    public static final int NOTIFICATION_ZEN_MODE_SCHEDULE_RULE = 144;
    public static final int NOTIFICATION_ZEN_MODE_EXTERNAL_RULE = 145;
    public static final int ACTION_BAN_APP_NOTES = 146;

    public static void visible(Context context, int category) throws IllegalArgumentException {
        if (Build.IS_DEBUGGABLE && category == VIEW_UNKNOWN) {
@@ -46,10 +47,14 @@ public class MetricsLogger implements MetricsConstants {
    }

    public static void action(Context context, int category) {
        action(context, category, "");
    }

    public static void action(Context context, int category, String pkg) {
        if (Build.IS_DEBUGGABLE && category == VIEW_UNKNOWN) {
            throw new IllegalArgumentException("Must define metric category");
        }
        EventLogTags.writeSysuiAction(category);
        EventLogTags.writeSysuiAction(category, pkg);
    }

    /** Add an integer value to the monotonically increasing counter with the given name. */