Fix the current asynchronous API to use callback like the way
was done with p2p API.
In the process, fix the use of WPS
Change-Id: Ib6f8714cf51b3525b655948268804e7eaaf17587
Moved away from BufferedReader, which only reads the first 8KB of
some proc files because it aggresively fills its buffer. Optimized
proc parsing, now double the speed. Tests to cover.
Log when NetworkStats counters roll backwards when subtracting, and
optimizations around findIndex(). When system removes UID, also
remove from last stats snapshot to avoid xt counters from rolling
backwards.
Bug: 5472949, 5458380
Change-Id: I07c08fe5233156fac2b84450f6291868bf9bfaf2
Teach NetworkStats about "counter sets" coming from kernel, and use
them to track usage in foreground/background. Add AID_NET_BW_ACCT to
system_server so it can control counter sets.
Move to composite key of NetworkIdentitySet, UID, set, and tag when
recording historical usage. Persisting still clusters by identity,
since that is heaviest object.
Request async stats poll during systemReady() to bootstrap later
delta calculations. Reset kernel counters when UID removed. Update
various tests.
Bug: 5105592, 5146067
Change-Id: Idabec9e3ffcaf212879821515602ecde0a03de8c