commit | ad5e2827ead7fa8ebafc291ceb6b4672e70c1775 | [log] [tgz] |
---|---|---|
author | Hugo Benichi <hugobenichi@google.com> | Mon Aug 07 15:47:35 2017 +0900 |
committer | Hugo Benichi <hugobenichi@google.com> | Tue Aug 08 09:19:05 2017 +0900 |
tree | 6f48c8a218b990d616e60dc3ae14ecf779c7aebd | |
parent | 82e815616e1fcab7bcdab737dfc1a28946b0f486 [diff] |
NetworkStats: more robust subtraction for deltas This patch ensures that subtract() between two NetworkStats object will return a delta with no negative entries in all cases. When the stats delta contains some negative values, there are clamped to 0. Some logging is added when this happens. This is what's expected by NetworkStatsHistory#recordData(). Bug: 64365917 Test: runtest frameworks-net Change-Id: I16e97e73f600225f80e0ce517e80c07c6f399196