Watch network subtype, tethering teardown, empty.

Watch for changes to telephony network subtype, and update iface
mapping to persist stats under correct type.  Update network stats
before removing tethering NAT rules.

Skip recording that would create empty historical buckets.  Query UID
stats before iface stats to always skew positive when counters are
actively rolling forward.

Bug: 5360042, 5359860, 5335674, 5334448
Change-Id: I8aa37b568e8ffb70647218aa1aff5195d3e44d5a
This commit is contained in:
Jeff Sharkey
2011-09-22 14:59:51 -07:00
parent 745f1e3a06
commit 367d15ab1a
6 changed files with 102 additions and 30 deletions

View File

@@ -270,6 +270,11 @@ public class NetworkStatsHistory implements Parcelable {
|| entry.operations < 0) {
throw new IllegalArgumentException("tried recording negative data");
}
if (entry.rxBytes == 0 && entry.rxPackets == 0 && entry.txBytes == 0 && entry.txPackets == 0
&& entry.operations == 0) {
// nothing to record; skip
return;
}
// create any buckets needed by this range
ensureBuckets(start, end);