Loading api/current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -26002,6 +26002,7 @@ package android.net { method public boolean protect(java.net.DatagramSocket); method public boolean setUnderlyingNetworks(android.net.Network[]); field public static final java.lang.String SERVICE_INTERFACE = "android.net.VpnService"; field public static final java.lang.String SERVICE_META_DATA_SUPPORTS_ALWAYS_ON = "android.net.VpnService.SUPPORTS_ALWAYS_ON"; } public class VpnService.Builder { api/system-current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -28266,6 +28266,7 @@ package android.net { method public boolean protect(java.net.DatagramSocket); method public boolean setUnderlyingNetworks(android.net.Network[]); field public static final java.lang.String SERVICE_INTERFACE = "android.net.VpnService"; field public static final java.lang.String SERVICE_META_DATA_SUPPORTS_ALWAYS_ON = "android.net.VpnService.SUPPORTS_ALWAYS_ON"; } public class VpnService.Builder { api/test-current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -26111,6 +26111,7 @@ package android.net { method public boolean protect(java.net.DatagramSocket); method public boolean setUnderlyingNetworks(android.net.Network[]); field public static final java.lang.String SERVICE_INTERFACE = "android.net.VpnService"; field public static final java.lang.String SERVICE_META_DATA_SUPPORTS_ALWAYS_ON = "android.net.VpnService.SUPPORTS_ALWAYS_ON"; } public class VpnService.Builder { core/java/android/app/admin/DevicePolicyManager.java +9 −18 Original line number Diff line number Diff line Loading @@ -55,7 +55,6 @@ import android.os.RemoteException; import android.os.UserHandle; import android.os.UserManager; import android.provider.ContactsContract.Directory; import android.provider.Settings; import android.security.Credentials; import android.service.restrictions.RestrictionsReceiver; import android.telephony.TelephonyManager; Loading Loading @@ -3902,28 +3901,20 @@ public class DevicePolicyManager { return null; } /** * Called by a device or profile owner to configure an always-on VPN connection through a * specific application for the current user. * * @deprecated this version only exists for compability with previous developer preview builds. * TODO: delete once there are no longer any live references. * @hide */ @Deprecated public void setAlwaysOnVpnPackage(@NonNull ComponentName admin, @Nullable String vpnPackage) throws NameNotFoundException, UnsupportedOperationException { setAlwaysOnVpnPackage(admin, vpnPackage, /* lockdownEnabled */ true); } /** * Called by a device or profile owner to configure an always-on VPN connection through a * specific application for the current user. This connection is automatically granted and * persisted after a reboot. * <p> * The designated package should declare a {@link android.net.VpnService} in its manifest * guarded by {@link android.Manifest.permission#BIND_VPN_SERVICE}, otherwise the call will * fail. * To support the always-on feature, an app must * <ul> * <li>declare a {@link android.net.VpnService} in its manifest, guarded by * {@link android.Manifest.permission#BIND_VPN_SERVICE};</li> * <li>target {@link android.os.Build.VERSION_CODES#N API 24} or above; and</li> * <li><i>not</i> explicitly opt out of the feature through * {@link android.net.VpnService#SERVICE_META_DATA_SUPPORTS_ALWAYS_ON}.</li> * </ul> * The call will fail if called with the package name of an unsupported VPN app. * * @param vpnPackage The package name for an installed VPN app on the device, or {@code null} to * remove an existing always-on VPN configuration. Loading core/java/android/net/ConnectivityManager.java +23 −0 Original line number Diff line number Diff line Loading @@ -834,6 +834,29 @@ public class ConnectivityManager { } } /** * Checks if a VPN app supports always-on mode. * * In order to support the always-on feature, an app has to * <ul> * <li>target {@link VERSION_CODES#N API 24} or above, and * <li>not opt out through the {@link VpnService#SERVICE_META_DATA_SUPPORTS_ALWAYS_ON} * meta-data field. * </ul> * * @param userId The identifier of the user for whom the VPN app is installed. * @param vpnPackage The canonical package name of the VPN app. * @return {@code true} if and only if the VPN app exists and supports always-on mode. * @hide */ public boolean isAlwaysOnVpnPackageSupportedForUser(int userId, @Nullable String vpnPackage) { try { return mService.isAlwaysOnVpnPackageSupported(userId, vpnPackage); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } } /** * Configures an always-on VPN connection through a specific application. * This connection is automatically granted and persisted after a reboot. Loading Loading
api/current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -26002,6 +26002,7 @@ package android.net { method public boolean protect(java.net.DatagramSocket); method public boolean setUnderlyingNetworks(android.net.Network[]); field public static final java.lang.String SERVICE_INTERFACE = "android.net.VpnService"; field public static final java.lang.String SERVICE_META_DATA_SUPPORTS_ALWAYS_ON = "android.net.VpnService.SUPPORTS_ALWAYS_ON"; } public class VpnService.Builder {
api/system-current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -28266,6 +28266,7 @@ package android.net { method public boolean protect(java.net.DatagramSocket); method public boolean setUnderlyingNetworks(android.net.Network[]); field public static final java.lang.String SERVICE_INTERFACE = "android.net.VpnService"; field public static final java.lang.String SERVICE_META_DATA_SUPPORTS_ALWAYS_ON = "android.net.VpnService.SUPPORTS_ALWAYS_ON"; } public class VpnService.Builder {
api/test-current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -26111,6 +26111,7 @@ package android.net { method public boolean protect(java.net.DatagramSocket); method public boolean setUnderlyingNetworks(android.net.Network[]); field public static final java.lang.String SERVICE_INTERFACE = "android.net.VpnService"; field public static final java.lang.String SERVICE_META_DATA_SUPPORTS_ALWAYS_ON = "android.net.VpnService.SUPPORTS_ALWAYS_ON"; } public class VpnService.Builder {
core/java/android/app/admin/DevicePolicyManager.java +9 −18 Original line number Diff line number Diff line Loading @@ -55,7 +55,6 @@ import android.os.RemoteException; import android.os.UserHandle; import android.os.UserManager; import android.provider.ContactsContract.Directory; import android.provider.Settings; import android.security.Credentials; import android.service.restrictions.RestrictionsReceiver; import android.telephony.TelephonyManager; Loading Loading @@ -3902,28 +3901,20 @@ public class DevicePolicyManager { return null; } /** * Called by a device or profile owner to configure an always-on VPN connection through a * specific application for the current user. * * @deprecated this version only exists for compability with previous developer preview builds. * TODO: delete once there are no longer any live references. * @hide */ @Deprecated public void setAlwaysOnVpnPackage(@NonNull ComponentName admin, @Nullable String vpnPackage) throws NameNotFoundException, UnsupportedOperationException { setAlwaysOnVpnPackage(admin, vpnPackage, /* lockdownEnabled */ true); } /** * Called by a device or profile owner to configure an always-on VPN connection through a * specific application for the current user. This connection is automatically granted and * persisted after a reboot. * <p> * The designated package should declare a {@link android.net.VpnService} in its manifest * guarded by {@link android.Manifest.permission#BIND_VPN_SERVICE}, otherwise the call will * fail. * To support the always-on feature, an app must * <ul> * <li>declare a {@link android.net.VpnService} in its manifest, guarded by * {@link android.Manifest.permission#BIND_VPN_SERVICE};</li> * <li>target {@link android.os.Build.VERSION_CODES#N API 24} or above; and</li> * <li><i>not</i> explicitly opt out of the feature through * {@link android.net.VpnService#SERVICE_META_DATA_SUPPORTS_ALWAYS_ON}.</li> * </ul> * The call will fail if called with the package name of an unsupported VPN app. * * @param vpnPackage The package name for an installed VPN app on the device, or {@code null} to * remove an existing always-on VPN configuration. Loading
core/java/android/net/ConnectivityManager.java +23 −0 Original line number Diff line number Diff line Loading @@ -834,6 +834,29 @@ public class ConnectivityManager { } } /** * Checks if a VPN app supports always-on mode. * * In order to support the always-on feature, an app has to * <ul> * <li>target {@link VERSION_CODES#N API 24} or above, and * <li>not opt out through the {@link VpnService#SERVICE_META_DATA_SUPPORTS_ALWAYS_ON} * meta-data field. * </ul> * * @param userId The identifier of the user for whom the VPN app is installed. * @param vpnPackage The canonical package name of the VPN app. * @return {@code true} if and only if the VPN app exists and supports always-on mode. * @hide */ public boolean isAlwaysOnVpnPackageSupportedForUser(int userId, @Nullable String vpnPackage) { try { return mService.isAlwaysOnVpnPackageSupported(userId, vpnPackage); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } } /** * Configures an always-on VPN connection through a specific application. * This connection is automatically granted and persisted after a reboot. Loading