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

Commit 4902da45 authored by Chris Wren's avatar Chris Wren
Browse files

add a mechanism for logging actions

Change-Id: I60163e44602b8e23b643b9103c324fa0e0d2c4c4
parent 3622c20f
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -4,4 +4,4 @@ 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),(type|1|6)
524288 sysui_action (category|1|5)
+14 −0
Original line number Diff line number Diff line
@@ -31,6 +31,13 @@ public class MetricsLogger implements MetricsConstants {
    public static final int MANAGE_APPLICATIONS_ALL = 134;
    public static final int MANAGE_APPLICATIONS_NOTIFICATIONS = 135;

    public static final int ACTION_WIFI_ADD_NETWORK = 136;
    public static final int ACTION_WIFI_CONNECT = 137;
    public static final int ACTION_WIFI_FORCE_SCAN = 138;
    public static final int ACTION_WIFI_FORGET = 139;
    public static final int ACTION_WIFI_OFF = 140;
    public static final int ACTION_WIFI_ON = 141;

    public static void visible(Context context, int category) throws IllegalArgumentException {
        if (Build.IS_DEBUGGABLE && category == VIEW_UNKNOWN) {
            throw new IllegalArgumentException("Must define metric category");
@@ -44,4 +51,11 @@ public class MetricsLogger implements MetricsConstants {
        }
        EventLogTags.writeSysuiViewVisibility(category, 0);
    }

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