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 Bug: 65439160 Test: runtest frameworks-net Merged-In: I16e97e73f600225f80e0ce517e80c07c6f399196 Merged-In: I2ac0bc3914cb65ae8ee27921856d698dc59624b2 Merged-In: I67d5dc4b52b254748ff17fe1e16c2eeb1d03c30d Merged-In: Ib488fb034f72c92f19916490981342a3ef2eb33b (cherry picked from commit ad5e2827) Change-Id: Ic86b65a65a2517c871221f8784088ec1de18f534
Loading
Please register or sign in to comment