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 f7d44fa995
commit 6a2cbb63b3
2 changed files with 80 additions and 24 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);