diff options
author | Robert Greenwalt <rgreenwalt@google.com> | 2010-12-02 11:31:00 -0800 |
---|---|---|
committer | Robert Greenwalt <rgreenwalt@google.com> | 2010-12-02 12:19:17 -0800 |
commit | b7090d68be1046e7b8743620592bb63c8256eeab (patch) | |
tree | 9db257e8d07b6865ecd5a46d52d35e389579f5df /services/java | |
parent | 5e3af5fcba360916f38753bd505e47040fc87729 (diff) | |
download | frameworks_base-b7090d68be1046e7b8743620592bb63c8256eeab.zip frameworks_base-b7090d68be1046e7b8743620592bb63c8256eeab.tar.gz frameworks_base-b7090d68be1046e7b8743620592bb63c8256eeab.tar.bz2 |
Load persisted global proxy settings.
Was persisted before, but not loaded at boot.
Change-Id: I6d6b69ede3d212a8266847d73d07a037ae917788
Diffstat (limited to 'services/java')
-rw-r--r-- | services/java/com/android/server/ConnectivityService.java | 18 |
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 5c67da7..b5e3888 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; |