diff options
| author | Robert Greenwalt <rgreenwalt@google.com> | 2013-04-10 15:32:18 -0700 |
|---|---|---|
| committer | Robert Greenwalt <rgreenwalt@google.com> | 2013-04-10 15:32:18 -0700 |
| commit | a9bebc221108dd679da0557963605cd704d05743 (patch) | |
| tree | 1464de3d1e8c52f25680b6e80fc5391ee39b1902 /services/java/com/android/server/ConnectivityService.java | |
| parent | 8d06cc6d871fce6d5d6b6283027d4625edd92550 (diff) | |
Use CONNECTIVITY_INTERNAL for global proxy
The Global http proxy shouldn't be used by apps, but can be useful in certain
conditions.
bug:8264794
bug:8557674
Change-Id: Ia3cbe542e448d9e74d0492626a13e9fd34ad797a
Diffstat (limited to 'services/java/com/android/server/ConnectivityService.java')
| -rw-r--r-- | services/java/com/android/server/ConnectivityService.java | 15 |
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 ffc36723eba2..9adf945bd8ac 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) { |
