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

Commit 3db024af authored by Chris Wren's avatar Chris Wren
Browse files

Add optional package context to sysui action metrics.

Bug: 20451514
Change-Id: I3c671d9aa05e02d66168211b77128443c544609d
parent 17e11fad
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. */