Define TRANSPORT_USB in NetworkCapabilitiesUtils temporarily
The new API constant - TRANSPORT_USB didn't in mainline
branch, so the user of TRANSPORT_USB will get build break
when it is built in mainline branch.
Define TRANSPORT_USB in NetworkCapabilitiesUtils temporarily
is a workaround to fix this problem, and it should be removed
once downstream branches are S-based.
(clean cherry-pick)
Bug: 184158327
Test: m
Merged-In: I83560c75761e7008b457a66296364cb4ce24db50
Change-Id: I83560c75761e7008b457a66296364cb4ce24db50
diff --git a/common/framework/com/android/net/module/util/NetworkCapabilitiesUtils.java b/common/framework/com/android/net/module/util/NetworkCapabilitiesUtils.java
index 382ed9f..d4b1c9e 100644
--- a/common/framework/com/android/net/module/util/NetworkCapabilitiesUtils.java
+++ b/common/framework/com/android/net/module/util/NetworkCapabilitiesUtils.java
@@ -47,6 +47,12 @@
* @hide
*/
public final class NetworkCapabilitiesUtils {
+ /**
+ * See android.net.NetworkCapabilities.TRANSPORT_USB
+ * TODO: Use API constant when all downstream branches are S-based
+ */
+ public static final int TRANSPORT_USB = 8;
+
// Transports considered to classify networks in UI, in order of which transport should be
// surfaced when there are multiple transports. Transports not in this list do not have
// an ordering preference (in practice they will have a deterministic order based on the
@@ -64,7 +70,8 @@
TRANSPORT_WIFI_AWARE,
TRANSPORT_BLUETOOTH,
TRANSPORT_WIFI,
- TRANSPORT_ETHERNET
+ TRANSPORT_ETHERNET,
+ TRANSPORT_USB
// Notably, TRANSPORT_TEST is not in this list as any network that has TRANSPORT_TEST and
// one of the above transports should be counted as that transport, to keep tests as