diff options
author | Paul Jensen <pauljensen@google.com> | 2015-05-06 07:32:40 -0400 |
---|---|---|
committer | Paul Jensen <pauljensen@google.com> | 2015-05-18 17:05:51 +0000 |
commit | cee9b51c4beec4494d78bab784ba7e7e20c30e31 (patch) | |
tree | 476a7d99339932792943e87fc646546469a5fb1c /core/jni | |
parent | 424681e43e454bfcbceb863ddccb875ea57ec26f (diff) | |
download | frameworks_base-cee9b51c4beec4494d78bab784ba7e7e20c30e31.zip frameworks_base-cee9b51c4beec4494d78bab784ba7e7e20c30e31.tar.gz frameworks_base-cee9b51c4beec4494d78bab784ba7e7e20c30e31.tar.bz2 |
Query HTTP proxy for network via a new API to avoid permissions exceptions
Add @hidden ConnectivityManager.getProxyForNetwork() API.
Bug:20470604
Change-Id: I6a9bc4afc8273bc43b14cdeccfedbbf3ff66be40
Diffstat (limited to 'core/jni')
-rw-r--r-- | core/jni/android_net_NetUtils.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/core/jni/android_net_NetUtils.cpp b/core/jni/android_net_NetUtils.cpp index 60e8ed0..fada7ac 100644 --- a/core/jni/android_net_NetUtils.cpp +++ b/core/jni/android_net_NetUtils.cpp @@ -291,6 +291,11 @@ static jboolean android_net_utils_protectFromVpn(JNIEnv *env, jobject thiz, jint return (jboolean) !protectFromVpn(socket); } +static jboolean android_net_utils_queryUserAccess(JNIEnv *env, jobject thiz, jint uid, jint netId) +{ + return (jboolean) !queryUserAccess(uid, netId); +} + // ---------------------------------------------------------------------------- @@ -311,6 +316,7 @@ static JNINativeMethod gNetworkUtilMethods[] = { { "bindProcessToNetworkForHostResolution", "(I)Z", (void*) android_net_utils_bindProcessToNetworkForHostResolution }, { "bindSocketToNetwork", "(II)I", (void*) android_net_utils_bindSocketToNetwork }, { "protectFromVpn", "(I)Z", (void*)android_net_utils_protectFromVpn }, + { "queryUserAccess", "(II)Z", (void*)android_net_utils_queryUserAccess }, { "attachDhcpFilter", "(Ljava/io/FileDescriptor;)V", (void*) android_net_utils_attachDhcpFilter }, }; |