diff options
| author | 2012-11-02 15:49:19 -0700 | |
|---|---|---|
| committer | 2012-11-02 15:49:20 -0700 | |
| commit | 1c743650addb9f632dd3eb39d4b17109ee4171f5 (patch) | |
| tree | 059dcbc5041e4b4b42333967059ed575b77ac94e | |
| parent | e96e0a1a759a524072cc3fb1dfd3ec01e18ef67f (diff) | |
| parent | b0a579f83369ca2daa885222a35f1cd3c054ab11 (diff) | |
Merge "Sanity check network stats coming from disk." into jb-mr1-dev
| -rw-r--r-- | core/java/android/net/NetworkStatsHistory.java | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/core/java/android/net/NetworkStatsHistory.java b/core/java/android/net/NetworkStatsHistory.java index a37c26f90d73..382b25e3773e 100644 --- a/core/java/android/net/NetworkStatsHistory.java +++ b/core/java/android/net/NetworkStatsHistory.java @@ -177,6 +177,12 @@ public class NetworkStatsHistory implements Parcelable { throw new ProtocolException("unexpected version: " + version); } } + + if (bucketStart.length != bucketCount || rxBytes.length != bucketCount + || rxPackets.length != bucketCount || txBytes.length != bucketCount + || txPackets.length != bucketCount || operations.length != bucketCount) { + throw new ProtocolException("Mismatched history lengths"); + } } public void writeToStream(DataOutputStream out) throws IOException { |