summaryrefslogtreecommitdiffstats
path: root/services/java
diff options
context:
space:
mode:
authorRobert Greenwalt <rgreenwalt@google.com>2013-04-11 14:16:28 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2013-04-11 14:16:28 -0700
commit63582a790e891780f391a1f8c6ee30837455421f (patch)
tree43da3ec1a454b7a889b18586c024b20b433792d2 /services/java
parentc5931edb4c8d95e90ac739ec88d8fca2610a57f1 (diff)
parentccbe7e6ff16fe1afc08f0b8601d83481ba5aee3a (diff)
downloadframeworks_base-63582a790e891780f391a1f8c6ee30837455421f.zip
frameworks_base-63582a790e891780f391a1f8c6ee30837455421f.tar.gz
frameworks_base-63582a790e891780f391a1f8c6ee30837455421f.tar.bz2
am ccbe7e6f: Merge "Use CONNECTIVITY_INTERNAL for global proxy" into jb-mr2-dev
* commit 'ccbe7e6ff16fe1afc08f0b8601d83481ba5aee3a': Use CONNECTIVITY_INTERNAL for global proxy
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) {