commit | d680d4c856f54bea0c60dea74ba4204822391e49 | [log] [tgz] |
---|---|---|
author | Hugo Benichi <hugobenichi@google.com> | Thu Oct 13 13:16:16 2016 +0900 |
committer | Hugo Benichi <hugobenichi@google.com> | Mon Oct 17 16:24:19 2016 +0900 |
tree | 15fad5e3dffe23717c6013ee810015d4f095a8cb | |
parent | daeeda35d951e9b6925a98cd0d909a59a94bd59f [diff] [blame] |
IpConnectivity metrics: add version number This patch adds a version field to ipconnectivity.proto and populates it to 2, which is the logical version number for NYC-MR2. Test: IpConnectivity{EventBuilder,Metrics}Test pass Bug: 32127906 Change-Id: I1439f012b7f9b4211d5d5429c274ad03d2ac9d6b
diff --git a/services/core/java/com/android/server/connectivity/IpConnectivityEventBuilder.java b/services/core/java/com/android/server/connectivity/IpConnectivityEventBuilder.java index f1ef947..f1d01e0 100644 --- a/services/core/java/com/android/server/connectivity/IpConnectivityEventBuilder.java +++ b/services/core/java/com/android/server/connectivity/IpConnectivityEventBuilder.java
@@ -48,6 +48,10 @@ final IpConnectivityLog log = new IpConnectivityLog(); log.events = toProto(events); log.droppedEvents = dropped; + if ((log.events.length > 0) || (dropped > 0)) { + // Only write version number if log has some information at all. + log.version = IpConnectivityMetrics.VERSION; + } return IpConnectivityLog.toByteArray(log); }