From cbe178fa8023b8f9842ee8ae9b7a1c03ad3d3bec Mon Sep 17 00:00:00 2001 From: Hugo Benichi Date: Wed, 15 Mar 2017 23:05:01 +0900 Subject: [PATCH] Connectivity metrics: serialize networkId, transports, ifname This patch adds translation from ConnectivityMetricsEvent to IpConnectivityEvent of recently added fields: - top-level network id - top-level ifname - transports Also adds inference of link layer from transports or ifname. At the moment these new fields are not populated in ConnectivityMetricsEvent. Follow-up patches will fill this gap for the events of the android.net.metrics package. Test: new unit tests, $ runtest frameworks-net passes Bug: 34901696 Merged-In: I563a6a3183470bdfaabb7c781a1beaf6b1058bf0 (partial cherry pick from commit 45f6ef836deb7c9e6d2f49dff9fe2b0c722e4f4f) Change-Id: I6a00270e73a1bd07f23c367f2394d90a43ced47a Test: runtest frameworks-net (not in original commit message) --- core/java/android/net/NetworkCapabilities.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/core/java/android/net/NetworkCapabilities.java b/core/java/android/net/NetworkCapabilities.java index 1da0d28153..bf7207ca5b 100644 --- a/core/java/android/net/NetworkCapabilities.java +++ b/core/java/android/net/NetworkCapabilities.java @@ -418,8 +418,10 @@ public final class NetworkCapabilities implements Parcelable { */ public static final int TRANSPORT_WIFI_AWARE = 5; - private static final int MIN_TRANSPORT = TRANSPORT_CELLULAR; - private static final int MAX_TRANSPORT = TRANSPORT_WIFI_AWARE; + /** @hide */ + public static final int MIN_TRANSPORT = TRANSPORT_CELLULAR; + /** @hide */ + public static final int MAX_TRANSPORT = TRANSPORT_WIFI_AWARE; private static final String[] TRANSPORT_NAMES = { "CELLULAR",