Loading api/current.txt +2 −0 Original line number Diff line number Diff line Loading @@ -16814,12 +16814,14 @@ package android.net { public class VpnService extends android.app.Service { ctor public VpnService(); method public boolean addAddress(java.net.InetAddress, int); method public android.os.IBinder onBind(android.content.Intent); method public void onRevoke(); method public static android.content.Intent prepare(android.content.Context); method public boolean protect(int); method public boolean protect(java.net.Socket); method public boolean protect(java.net.DatagramSocket); method public boolean removeAddress(java.net.InetAddress, int); field public static final java.lang.String SERVICE_INTERFACE = "android.net.VpnService"; } core/java/android/net/VpnService.java +38 −0 Original line number Diff line number Diff line Loading @@ -201,6 +201,44 @@ public class VpnService extends Service { return protect(socket.getFileDescriptor$().getInt$()); } /** * Adds a network address to the VPN interface. * * Both IPv4 and IPv6 addresses are supported. The VPN must already be established. Fails if the * address is already in use or cannot be assigned to the interface for any other reason. * * @throws {@link IllegalArgumentException} if the address is invalid. * * @param address The IP address (IPv4 or IPv6) to assign to the VPN interface. * @param prefixLength The prefix length of the address. * * @return {@code true} on success. * @see Builder#addAddress */ public boolean addAddress(InetAddress address, int prefixLength) { // TODO return true; } /** * Removes a network address from the VPN interface. * * Both IPv4 and IPv6 addresses are supported. The VPN must already be established. Fails if the * address is not assigned to the VPN interface, or if it is the only address assigned (thus * cannot be removed), or if the address cannot be removed for any other reason. * * @throws {@link IllegalArgumentException} if the address is invalid. * * @param address The IP address (IPv4 or IPv6) to assign to the VPN interface. * @param prefixLength The prefix length of the address. * * @return {@code true} on success. */ public boolean removeAddress(InetAddress address, int prefixLength) { // TODO return true; } /** * Return the communication interface to the service. This method returns * {@code null} on {@link Intent}s other than {@link #SERVICE_INTERFACE} Loading Loading
api/current.txt +2 −0 Original line number Diff line number Diff line Loading @@ -16814,12 +16814,14 @@ package android.net { public class VpnService extends android.app.Service { ctor public VpnService(); method public boolean addAddress(java.net.InetAddress, int); method public android.os.IBinder onBind(android.content.Intent); method public void onRevoke(); method public static android.content.Intent prepare(android.content.Context); method public boolean protect(int); method public boolean protect(java.net.Socket); method public boolean protect(java.net.DatagramSocket); method public boolean removeAddress(java.net.InetAddress, int); field public static final java.lang.String SERVICE_INTERFACE = "android.net.VpnService"; }
core/java/android/net/VpnService.java +38 −0 Original line number Diff line number Diff line Loading @@ -201,6 +201,44 @@ public class VpnService extends Service { return protect(socket.getFileDescriptor$().getInt$()); } /** * Adds a network address to the VPN interface. * * Both IPv4 and IPv6 addresses are supported. The VPN must already be established. Fails if the * address is already in use or cannot be assigned to the interface for any other reason. * * @throws {@link IllegalArgumentException} if the address is invalid. * * @param address The IP address (IPv4 or IPv6) to assign to the VPN interface. * @param prefixLength The prefix length of the address. * * @return {@code true} on success. * @see Builder#addAddress */ public boolean addAddress(InetAddress address, int prefixLength) { // TODO return true; } /** * Removes a network address from the VPN interface. * * Both IPv4 and IPv6 addresses are supported. The VPN must already be established. Fails if the * address is not assigned to the VPN interface, or if it is the only address assigned (thus * cannot be removed), or if the address cannot be removed for any other reason. * * @throws {@link IllegalArgumentException} if the address is invalid. * * @param address The IP address (IPv4 or IPv6) to assign to the VPN interface. * @param prefixLength The prefix length of the address. * * @return {@code true} on success. */ public boolean removeAddress(InetAddress address, int prefixLength) { // TODO return true; } /** * Return the communication interface to the service. This method returns * {@code null} on {@link Intent}s other than {@link #SERVICE_INTERFACE} Loading