Loading Android.bp +1 −1 Original line number Diff line number Diff line Loading @@ -635,7 +635,7 @@ genrule { name: "framework-statslog-gen", tools: ["stats-log-api-gen"], cmd: "$(location stats-log-api-gen) --java $(out)", out: ["android/util/StatsLog.java"], out: ["android/util/StatsLogInternal.java"], } gensrcs { Loading api/current.txt +6 −0 Original line number Diff line number Diff line Loading @@ -44400,6 +44400,12 @@ package android.util { field public static final int[] WILD_CARD; } public final class StatsLog { method public static boolean logEvent(int); method public static boolean logStart(int); method public static boolean logStop(int); } public class StringBuilderPrinter implements android.util.Printer { ctor public StringBuilderPrinter(java.lang.StringBuilder); method public void println(java.lang.String); cmds/statsd/src/atoms.proto +24 −0 Original line number Diff line number Diff line Loading @@ -79,6 +79,7 @@ message Atom { IsolatedUidChanged isolated_uid_changed = 43; PacketWakeupOccurred packet_wakeup_occurred = 44; DropboxErrorChanged dropbox_error_changed = 45; AppHook app_hook = 46; // TODO: Reorder the numbering so that the most frequent occur events occur in the first 15. } Loading Loading @@ -801,6 +802,29 @@ message DropboxErrorChanged { optional int32 is_foreground = 7; } /* * Allows other apps to push events into statsd. * Logged from: * frameworks/base/core/java/android/util/StatsLog.java */ message AppHook { // The uid of the application that sent this custom atom. optional int32 uid = 1; // An arbitrary label chosen by the developer. For Android P, the label should be in [0, 16). optional int32 label = 2; // Allows applications to easily use a custom event as start/stop boundaries (ie, define custom // predicates for the metrics). enum State { UNKNOWN = 0; UNSPECIFIED = 1; // For events that are known to not represent START/STOP. STOP = 2; START = 3; } optional State state = 3; } /** * Pulls bytes transferred via wifi (Sum of foreground and background usage). * Loading cmds/statsd/tools/dogfood/res/layout/activity_main.xml +17 −0 Original line number Diff line number Diff line Loading @@ -111,6 +111,23 @@ android:text="@string/screen_off"/> </LinearLayout> <LinearLayout android:layout_width="wrap_content" android:layout_height="wrap_content" android:orientation="horizontal"> <Button android:id="@+id/custom_start" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/custom_start" /> <Button android:id="@+id/custom_stop" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/custom_stop" /> </LinearLayout> <Button android:id="@+id/dump" android:layout_width="wrap_content" android:layout_height="wrap_content" Loading cmds/statsd/tools/dogfood/res/values/strings.xml +3 −0 Original line number Diff line number Diff line Loading @@ -47,6 +47,9 @@ <string name="screen_on">Screen On</string> <string name="screen_off">Screen Off</string> <string name="custom_start">App hook start</string> <string name="custom_stop">App hook stop</string> <string name="dump">DumpReport</string> <string name="report_header">Report details</string> </resources> Loading
Android.bp +1 −1 Original line number Diff line number Diff line Loading @@ -635,7 +635,7 @@ genrule { name: "framework-statslog-gen", tools: ["stats-log-api-gen"], cmd: "$(location stats-log-api-gen) --java $(out)", out: ["android/util/StatsLog.java"], out: ["android/util/StatsLogInternal.java"], } gensrcs { Loading
api/current.txt +6 −0 Original line number Diff line number Diff line Loading @@ -44400,6 +44400,12 @@ package android.util { field public static final int[] WILD_CARD; } public final class StatsLog { method public static boolean logEvent(int); method public static boolean logStart(int); method public static boolean logStop(int); } public class StringBuilderPrinter implements android.util.Printer { ctor public StringBuilderPrinter(java.lang.StringBuilder); method public void println(java.lang.String);
cmds/statsd/src/atoms.proto +24 −0 Original line number Diff line number Diff line Loading @@ -79,6 +79,7 @@ message Atom { IsolatedUidChanged isolated_uid_changed = 43; PacketWakeupOccurred packet_wakeup_occurred = 44; DropboxErrorChanged dropbox_error_changed = 45; AppHook app_hook = 46; // TODO: Reorder the numbering so that the most frequent occur events occur in the first 15. } Loading Loading @@ -801,6 +802,29 @@ message DropboxErrorChanged { optional int32 is_foreground = 7; } /* * Allows other apps to push events into statsd. * Logged from: * frameworks/base/core/java/android/util/StatsLog.java */ message AppHook { // The uid of the application that sent this custom atom. optional int32 uid = 1; // An arbitrary label chosen by the developer. For Android P, the label should be in [0, 16). optional int32 label = 2; // Allows applications to easily use a custom event as start/stop boundaries (ie, define custom // predicates for the metrics). enum State { UNKNOWN = 0; UNSPECIFIED = 1; // For events that are known to not represent START/STOP. STOP = 2; START = 3; } optional State state = 3; } /** * Pulls bytes transferred via wifi (Sum of foreground and background usage). * Loading
cmds/statsd/tools/dogfood/res/layout/activity_main.xml +17 −0 Original line number Diff line number Diff line Loading @@ -111,6 +111,23 @@ android:text="@string/screen_off"/> </LinearLayout> <LinearLayout android:layout_width="wrap_content" android:layout_height="wrap_content" android:orientation="horizontal"> <Button android:id="@+id/custom_start" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/custom_start" /> <Button android:id="@+id/custom_stop" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/custom_stop" /> </LinearLayout> <Button android:id="@+id/dump" android:layout_width="wrap_content" android:layout_height="wrap_content" Loading
cmds/statsd/tools/dogfood/res/values/strings.xml +3 −0 Original line number Diff line number Diff line Loading @@ -47,6 +47,9 @@ <string name="screen_on">Screen On</string> <string name="screen_off">Screen Off</string> <string name="custom_start">App hook start</string> <string name="custom_stop">App hook stop</string> <string name="dump">DumpReport</string> <string name="report_header">Report details</string> </resources>