Merge "Move SocketUtils out of the connectivity module" am: 4eb9b18e02

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1592273

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ib2d4b5574ba710eb50c438144e2b87f6c8954336
This commit is contained in:
Remi NGUYEN VAN
2021-03-02 19:48:26 +00:00
committed by Automerger Merge Worker
9 changed files with 49 additions and 45 deletions

View File

@@ -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.