Adds pulling for network bytes for statsd.
Adds atoms to collect network bytes transmitted and received via wifi
and mobile data. We need to get the list of correct ifaces from
BatteryStats since NetworkStatsService only tracks the mobile ifaces.
We split the atoms so that we can also capture metrics sliced on
foreground and background since they are available from the kernel.
Also adds an atom for the Kernel Wakelocks.
Test: Manually tested with adb shell cmd stats pull-source after
modifying the StatsPullerManager.cpp
Change-Id: I9467afad799c6d97560e868f8625fefae5c2b5e1
diff --git a/core/java/com/android/internal/os/BatteryStatsImpl.java b/core/java/com/android/internal/os/BatteryStatsImpl.java
index f0d05da..0535ebe 100644
--- a/core/java/com/android/internal/os/BatteryStatsImpl.java
+++ b/core/java/com/android/internal/os/BatteryStatsImpl.java
@@ -5412,6 +5412,18 @@
}
}
+ public String[] getWifiIfaces() {
+ synchronized (mWifiNetworkLock) {
+ return mWifiIfaces;
+ }
+ }
+
+ public String[] getMobileIfaces() {
+ synchronized (mModemNetworkLock) {
+ return mModemIfaces;
+ }
+ }
+
@Override public long getScreenOnTime(long elapsedRealtimeUs, int which) {
return mScreenOnTimer.getTotalTimeLocked(elapsedRealtimeUs, which);
}