summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Robert Greenwalt <rgreenwalt@google.com> 2010-12-02 12:30:02 -0800
committer Android (Google) Code Review <android-gerrit@google.com> 2010-12-02 12:30:02 -0800
commitc8f16ec9c8dc76091771cacac0a86d4d2534deaf (patch)
treeeb55181e798b0be3c1f3362afc1ff2593d5b5467
parenta69a3b26628f361117bc15e5c4aebe15306d8084 (diff)
parentb7090d68be1046e7b8743620592bb63c8256eeab (diff)
Merge "Load persisted global proxy settings."
-rw-r--r--services/java/com/android/server/ConnectivityService.java18
1 files changed, 17 insertions, 1 deletions
diff --git a/services/java/com/android/server/ConnectivityService.java b/services/java/com/android/server/ConnectivityService.java
index 5c67da7f4df4..b5e388844175 100644
--- a/services/java/com/android/server/ConnectivityService.java
+++ b/services/java/com/android/server/ConnectivityService.java
@@ -430,6 +430,8 @@ public class ConnectivityService extends IConnectivityManager.Stub {
mSettingsObserver = new SettingsObserver(mHandler, EVENT_APPLY_GLOBAL_HTTP_PROXY);
mSettingsObserver.observe(mContext);
+
+ loadGlobalProxy();
}
@@ -2089,7 +2091,7 @@ public class ConnectivityService extends IConnectivityManager.Stub {
ContentResolver res = mContext.getContentResolver();
Settings.Secure.putString(res, Settings.Secure.GLOBAL_HTTP_PROXY_HOST, host);
Settings.Secure.putInt(res, Settings.Secure.GLOBAL_HTTP_PROXY_PORT, port);
- Settings.Secure.putString(res,Settings.Secure.GLOBAL_HTTP_PROXY_EXCLUSION_LIST,
+ Settings.Secure.putString(res, Settings.Secure.GLOBAL_HTTP_PROXY_EXCLUSION_LIST,
exclList);
}
@@ -2099,6 +2101,20 @@ public class ConnectivityService extends IConnectivityManager.Stub {
sendProxyBroadcast(proxyProperties);
}
+ private void loadGlobalProxy() {
+ ContentResolver res = mContext.getContentResolver();
+ String host = Settings.Secure.getString(res, Settings.Secure.GLOBAL_HTTP_PROXY_HOST);
+ int port = Settings.Secure.getInt(res, Settings.Secure.GLOBAL_HTTP_PROXY_PORT, 0);
+ String exclList = Settings.Secure.getString(res,
+ Settings.Secure.GLOBAL_HTTP_PROXY_EXCLUSION_LIST);
+ if (!TextUtils.isEmpty(host)) {
+ ProxyProperties proxyProperties = new ProxyProperties(host, port, exclList);
+ synchronized (mGlobalProxyLock) {
+ mGlobalProxy = proxyProperties;
+ }
+ }
+ }
+
public ProxyProperties getGlobalProxy() {
synchronized (mGlobalProxyLock) {
return mGlobalProxy;