summaryrefslogtreecommitdiffstats
path: root/services/java
diff options
context:
space:
mode:
authorRobert Greenwalt <rgreenwalt@google.com>2013-04-11 21:11:44 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2013-04-11 21:11:44 +0000
commitccbe7e6ff16fe1afc08f0b8601d83481ba5aee3a (patch)
tree08c77b20358321f4f2aed91aa7a23ed5ff0034fd /services/java
parentc65e463356e9c8b646e80d0bfb6cfc76a0a1b426 (diff)
parenta9bebc221108dd679da0557963605cd704d05743 (diff)
downloadframeworks_base-ccbe7e6ff16fe1afc08f0b8601d83481ba5aee3a.zip
frameworks_base-ccbe7e6ff16fe1afc08f0b8601d83481ba5aee3a.tar.gz
frameworks_base-ccbe7e6ff16fe1afc08f0b8601d83481ba5aee3a.tar.bz2
Merge "Use CONNECTIVITY_INTERNAL for global proxy" into jb-mr2-dev
Diffstat (limited to 'services/java')
-rw-r--r--services/java/com/android/server/ConnectivityService.java15
1 files changed, 10 insertions, 5 deletions
diff --git a/services/java/com/android/server/ConnectivityService.java b/services/java/com/android/server/ConnectivityService.java
index ffc3672..9adf945 100644
--- a/services/java/com/android/server/ConnectivityService.java
+++ b/services/java/com/android/server/ConnectivityService.java
@@ -3045,7 +3045,7 @@ public class ConnectivityService extends IConnectivityManager.Stub {
}
public void setGlobalProxy(ProxyProperties proxyProperties) {
- enforceChangePermission();
+ enforceConnectivityInternalPermission();
synchronized (mProxyLock) {
if (proxyProperties == mGlobalProxy) return;
if (proxyProperties != null && proxyProperties.equals(mGlobalProxy)) return;
@@ -3063,10 +3063,15 @@ public class ConnectivityService extends IConnectivityManager.Stub {
mGlobalProxy = null;
}
ContentResolver res = mContext.getContentResolver();
- Settings.Global.putString(res, Settings.Global.GLOBAL_HTTP_PROXY_HOST, host);
- Settings.Global.putInt(res, Settings.Global.GLOBAL_HTTP_PROXY_PORT, port);
- Settings.Global.putString(res, Settings.Global.GLOBAL_HTTP_PROXY_EXCLUSION_LIST,
- exclList);
+ final long token = Binder.clearCallingIdentity();
+ try {
+ Settings.Global.putString(res, Settings.Global.GLOBAL_HTTP_PROXY_HOST, host);
+ Settings.Global.putInt(res, Settings.Global.GLOBAL_HTTP_PROXY_PORT, port);
+ Settings.Global.putString(res, Settings.Global.GLOBAL_HTTP_PROXY_EXCLUSION_LIST,
+ exclList);
+ } finally {
+ Binder.restoreCallingIdentity(token);
+ }
}
if (mGlobalProxy == null) {