Lightweight checkin output for network stats.
Define and print a compact version of network statistics when dump
is requested with the "--checkin" flag. Defaults to last 24 hours,
but included data can be tweaked with various flags.
Groups together detailed network identities into larger umbrella
terms like "mobile" and "wifi."
Bug: 18415963
Change-Id: I70cf9c828ea5c6e5bb6884837d3608f66fbad2e6
diff --git a/core/java/android/net/NetworkStats.java b/core/java/android/net/NetworkStats.java
index ea5dfd1..2afe578 100644
--- a/core/java/android/net/NetworkStats.java
+++ b/core/java/android/net/NetworkStats.java
@@ -733,6 +733,22 @@
}
/**
+ * Return text description of {@link #set} value.
+ */
+ public static String setToCheckinString(int set) {
+ switch (set) {
+ case SET_ALL:
+ return "all";
+ case SET_DEFAULT:
+ return "def";
+ case SET_FOREGROUND:
+ return "fg";
+ default:
+ return "unk";
+ }
+ }
+
+ /**
* Return text description of {@link #tag} value.
*/
public static String tagToString(int tag) {