From eab4a9c9842c454f3353281cf4a2751f52e544ed Mon Sep 17 00:00:00 2001 From: Chiachang Wang Date: Thu, 25 Mar 2021 14:28:15 +0800 Subject: [PATCH] Expose BIP and VSIM relavent definitions In order to support special APNs below, OEM may need extra NetworkCapabilities and apn type definition to support the carriers request. Add corresponding definition into API surface. VSIM: for Virtual SIM service BIP: for Bearer Independent Protocol Bug: 130869457 Test: make update-api Change-Id: I41e881c6fe39e92d5cdac2d0a02fa8a8e814c9c5 Merged-In: I41e881c6fe39e92d5cdac2d0a02fa8a8e814c9c5 --- framework/api/system-current.txt | 2 ++ .../src/android/net/NetworkCapabilities.java | 20 ++++++++++++++++++- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/framework/api/system-current.txt b/framework/api/system-current.txt index 8e6e846240..b64657e55e 100644 --- a/framework/api/system-current.txt +++ b/framework/api/system-current.txt @@ -268,11 +268,13 @@ package android.net { method @NonNull public int[] getTransportTypes(); method public boolean isPrivateDnsBroken(); method public boolean satisfiedByNetworkCapabilities(@Nullable android.net.NetworkCapabilities); + field public static final int NET_CAPABILITY_BIP = 31; // 0x1f field public static final int NET_CAPABILITY_NOT_VCN_MANAGED = 28; // 0x1c field public static final int NET_CAPABILITY_OEM_PAID = 22; // 0x16 field public static final int NET_CAPABILITY_OEM_PRIVATE = 26; // 0x1a field public static final int NET_CAPABILITY_PARTIAL_CONNECTIVITY = 24; // 0x18 field public static final int NET_CAPABILITY_VEHICLE_INTERNAL = 27; // 0x1b + field public static final int NET_CAPABILITY_VSIM = 30; // 0x1e } public static final class NetworkCapabilities.Builder { diff --git a/framework/src/android/net/NetworkCapabilities.java b/framework/src/android/net/NetworkCapabilities.java index 49248518d2..7e7089176e 100644 --- a/framework/src/android/net/NetworkCapabilities.java +++ b/framework/src/android/net/NetworkCapabilities.java @@ -274,6 +274,8 @@ public final class NetworkCapabilities implements Parcelable { NET_CAPABILITY_VEHICLE_INTERNAL, NET_CAPABILITY_NOT_VCN_MANAGED, NET_CAPABILITY_ENTERPRISE, + NET_CAPABILITY_VSIM, + NET_CAPABILITY_BIP, }) public @interface NetCapability { } @@ -493,8 +495,22 @@ public final class NetworkCapabilities implements Parcelable { */ public static final int NET_CAPABILITY_ENTERPRISE = 29; + /** + * Indicates that this network has ability to access the carrier's Virtual Sim service. + * @hide + */ + @SystemApi + public static final int NET_CAPABILITY_VSIM = 30; + + /** + * Indicates that this network has ability to support Bearer Independent Protol. + * @hide + */ + @SystemApi + public static final int NET_CAPABILITY_BIP = 31; + private static final int MIN_NET_CAPABILITY = NET_CAPABILITY_MMS; - private static final int MAX_NET_CAPABILITY = NET_CAPABILITY_ENTERPRISE; + private static final int MAX_NET_CAPABILITY = NET_CAPABILITY_BIP; /** * Network capabilities that are expected to be mutable, i.e., can change while a particular @@ -2101,6 +2117,8 @@ public final class NetworkCapabilities implements Parcelable { case NET_CAPABILITY_VEHICLE_INTERNAL: return "VEHICLE_INTERNAL"; case NET_CAPABILITY_NOT_VCN_MANAGED: return "NOT_VCN_MANAGED"; case NET_CAPABILITY_ENTERPRISE: return "ENTERPRISE"; + case NET_CAPABILITY_VSIM: return "VSIM"; + case NET_CAPABILITY_BIP: return "BIP"; default: return Integer.toString(capability); } }