Merge "Move SocketUtils out of the connectivity module" am: 4eb9b18e02 am: b3bc93fbcf am: 1efb1bf4a8
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1592273 MUST ONLY BE SUBMITTED BY AUTOMERGER Change-Id: I9de14464ebb9d43e7c4fdc683c23ddbbcc7ef269
This commit is contained in:
@@ -22,6 +22,8 @@ import static android.system.OsConstants.AF_INET6;
|
||||
import android.annotation.NonNull;
|
||||
import android.system.Os;
|
||||
|
||||
import java.io.FileDescriptor;
|
||||
|
||||
/** @hide */
|
||||
public class NetworkUtilsInternal {
|
||||
|
||||
@@ -35,6 +37,20 @@ public class NetworkUtilsInternal {
|
||||
*/
|
||||
public static native void setAllowNetworkingForProcess(boolean allowNetworking);
|
||||
|
||||
/**
|
||||
* Protect {@code fd} from VPN connections. After protecting, data sent through
|
||||
* this socket will go directly to the underlying network, so its traffic will not be
|
||||
* forwarded through the VPN.
|
||||
*/
|
||||
public static native boolean protectFromVpn(FileDescriptor fd);
|
||||
|
||||
/**
|
||||
* Protect {@code socketfd} from VPN connections. After protecting, data sent through
|
||||
* this socket will go directly to the underlying network, so its traffic will not be
|
||||
* forwarded through the VPN.
|
||||
*/
|
||||
public static native boolean protectFromVpn(int socketfd);
|
||||
|
||||
/**
|
||||
* Returns true if the hostname is weakly validated.
|
||||
* @param hostname Name of host to validate.
|
||||
|
||||
Reference in New Issue
Block a user