summaryrefslogtreecommitdiffstats
path: root/core/java/android/net
diff options
context:
space:
mode:
authorLorenzo Colitti <lorenzo@google.com>2015-03-17 17:56:10 +0900
committerLorenzo Colitti <lorenzo@google.com>2015-03-20 16:32:40 +0900
commitd41ca0fe7512e0f44ac65ed52def9a5811b6f00e (patch)
tree08c050928bc435b50cb86f2aac41eefe96a8bc92 /core/java/android/net
parentfe5ffce09c4a163ee9a190aedc9fd7cea38a576f (diff)
downloadframeworks_base-d41ca0fe7512e0f44ac65ed52def9a5811b6f00e.zip
frameworks_base-d41ca0fe7512e0f44ac65ed52def9a5811b6f00e.tar.gz
frameworks_base-d41ca0fe7512e0f44ac65ed52def9a5811b6f00e.tar.bz2
Add a protectFromVpn method that takes a FileDescriptor
Bug: 19704592 Change-Id: I9aeb29c2f6cf55fa010bc606c99b21a797ac5a19
Diffstat (limited to 'core/java/android/net')
-rw-r--r--core/java/android/net/NetworkUtils.java9
1 files changed, 9 insertions, 0 deletions
diff --git a/core/java/android/net/NetworkUtils.java b/core/java/android/net/NetworkUtils.java
index 01704e5..02fbe73 100644
--- a/core/java/android/net/NetworkUtils.java
+++ b/core/java/android/net/NetworkUtils.java
@@ -178,6 +178,15 @@ public class NetworkUtils {
public native static int bindSocketToNetwork(int socketfd, int netId);
/**
+ * 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 boolean protectFromVpn(FileDescriptor fd) {
+ return protectFromVpn(fd.getInt$());
+ }
+
+ /**
* 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.