diff options
| -rw-r--r-- | core/api/module-lib-current.txt | 2 | ||||
| -rw-r--r-- | core/java/android/net/VpnManager.java | 26 | ||||
| -rw-r--r-- | core/java/android/net/flags.aconfig | 8 |
3 files changed, 34 insertions, 2 deletions
diff --git a/core/api/module-lib-current.txt b/core/api/module-lib-current.txt index 526a213a6003..98570172e43c 100644 --- a/core/api/module-lib-current.txt +++ b/core/api/module-lib-current.txt @@ -304,6 +304,8 @@ package android.net { field public static final int TYPE_VPN_LEGACY = 3; // 0x3 field public static final int TYPE_VPN_NONE = -1; // 0xffffffff field public static final int TYPE_VPN_OEM = 4; // 0x4 + field @FlaggedApi("android.net.platform.flags.vpn_type_oem_service_and_legacy") public static final int TYPE_VPN_OEM_LEGACY = 6; // 0x6 + field @FlaggedApi("android.net.platform.flags.vpn_type_oem_service_and_legacy") public static final int TYPE_VPN_OEM_SERVICE = 5; // 0x5 field public static final int TYPE_VPN_PLATFORM = 2; // 0x2 field public static final int TYPE_VPN_SERVICE = 1; // 0x1 } diff --git a/core/java/android/net/VpnManager.java b/core/java/android/net/VpnManager.java index c50bc569de72..4ef293a90a80 100644 --- a/core/java/android/net/VpnManager.java +++ b/core/java/android/net/VpnManager.java @@ -20,6 +20,7 @@ import static android.annotation.SystemApi.Client.MODULE_LIBRARIES; import static com.android.internal.util.Preconditions.checkNotNull; +import android.annotation.FlaggedApi; import android.annotation.IntDef; import android.annotation.NonNull; import android.annotation.Nullable; @@ -32,6 +33,7 @@ import android.content.ComponentName; import android.content.Context; import android.content.Intent; import android.content.res.Resources; +import android.net.platform.flags.Flags; import android.os.RemoteException; import com.android.internal.net.LegacyVpnInfo; @@ -85,13 +87,33 @@ public class VpnManager { public static final int TYPE_VPN_LEGACY = 3; /** - * An VPN created by OEM code through other means than {@link VpnService} or {@link VpnManager}. + * A VPN created by OEM code through other means than {@link VpnService} or {@link VpnManager}. * @hide */ @SystemApi(client = MODULE_LIBRARIES) public static final int TYPE_VPN_OEM = 4; /** + * A VPN created by OEM code using {@link VpnService}, and which OEM code desires to + * differentiate from other VPN types. The core networking stack will treat this VPN type + * similarly to {@link #TYPE_VPN_SERVICE}. + * @hide + */ + @FlaggedApi(Flags.FLAG_VPN_TYPE_OEM_SERVICE_AND_LEGACY) + @SystemApi(client = MODULE_LIBRARIES) + public static final int TYPE_VPN_OEM_SERVICE = 5; + + /** + * A VPN created by OEM code using the legacy VPN mechanisms, and which OEM code desires to + * differentiate from other VPN types. The core networking stack will treat this VPN type + * similarly to {@link #TYPE_VPN_LEGACY}. + * @hide + */ + @FlaggedApi(Flags.FLAG_VPN_TYPE_OEM_SERVICE_AND_LEGACY) + @SystemApi(client = MODULE_LIBRARIES) + public static final int TYPE_VPN_OEM_LEGACY = 6; + + /** * Channel for VPN notifications. * @hide */ @@ -308,7 +330,7 @@ public class VpnManager { /** @hide */ @IntDef(value = {TYPE_VPN_NONE, TYPE_VPN_SERVICE, TYPE_VPN_PLATFORM, TYPE_VPN_LEGACY, - TYPE_VPN_OEM}) + TYPE_VPN_OEM, TYPE_VPN_OEM_SERVICE, TYPE_VPN_OEM_LEGACY}) @Retention(RetentionPolicy.SOURCE) public @interface VpnType {} diff --git a/core/java/android/net/flags.aconfig b/core/java/android/net/flags.aconfig index 8d12b76e23ff..519729bc1c88 100644 --- a/core/java/android/net/flags.aconfig +++ b/core/java/android/net/flags.aconfig @@ -37,3 +37,11 @@ flag { description: "Flag for MDNS quality, reliability and performance improvement in 25Q2" bug: "373270045" } + +flag { + name: "vpn_type_oem_service_and_legacy" + namespace: "android_core_networking" + is_exported: false + description: "Flags the TYPE_VPN_OEM_SERVICE and TYPE_VPN_OEM_LEGACY VpnManager API constants" + bug: "389829981" +} |