summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlucaslin <lucaslin@google.com>2021-04-06 09:54:45 +0800
committerRemi NGUYEN VAN <reminv@google.com>2021-07-14 16:30:10 +0900
commit4c087c18114ec0026b5cdf4824b34477cd8f77c2 (patch)
tree95dbde77a5a8d70d2db39876d0ff8e33399b3ca7
parentf829dd3c64d3f8f5038b9c20886675801519e66f (diff)
downloadnet-4c087c18114ec0026b5cdf4824b34477cd8f77c2.tar.gz
Define TRANSPORT_USB in NetworkCapabilitiesUtils temporarilyandroid-s-beta-4android-s-beta-3android-s-beta-4
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
-rw-r--r--common/framework/com/android/net/module/util/NetworkCapabilitiesUtils.java9
1 files changed, 8 insertions, 1 deletions
diff --git a/common/framework/com/android/net/module/util/NetworkCapabilitiesUtils.java b/common/framework/com/android/net/module/util/NetworkCapabilitiesUtils.java
index 382ed9f2..d4b1c9e0 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 @@ import com.android.internal.annotations.VisibleForTesting;
* @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 @@ public final class NetworkCapabilitiesUtils {
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