Add method to NetworkStatsService for UID stats.

Useful for clients such as BatteryStats which currently rely
on NetworkStatsFactory. Data at that stage is incomplete as
it does not account for tethering, VT data and corresponding
464xlat corrections.

Test: runtest frameworks-net, CTS tests pass.
Change-Id: I763b77f601c827fd2963204694fb5b45425cc791
This commit is contained in:
Remi NGUYEN VAN
2018-03-06 12:36:54 +09:00
parent bd12ffffc0
commit 1cb92c713f
4 changed files with 228 additions and 4 deletions

View File

@@ -184,7 +184,7 @@ public class NetworkStatsFactoryTest {
assertStatsEntry(stats, "dummy0", 0, SET_DEFAULT, 0x0, 0L, 168L);
assertStatsEntry(stats, "lo", 0, SET_DEFAULT, 0x0, 1288L, 1288L);
NetworkStatsFactory.noteStackedIface("v4-wlan0", null);
NetworkStatsFactory.clearStackedIfaces();
}
@Test
@@ -212,7 +212,7 @@ public class NetworkStatsFactoryTest {
assertStatsEntry(stats, "v4-wlan0", 10106, SET_FOREGROUND, 0x0, appRxBytesAfter, 7867488L);
assertStatsEntry(stats, "wlan0", 0, SET_DEFAULT, 0x0, rootRxBytesAfter, 647587L);
NetworkStatsFactory.noteStackedIface("v4-wlan0", null);
NetworkStatsFactory.clearStackedIfaces();
}
/**