diff options
| author | Robert Greenwalt <rgreenwalt@google.com> | 2010-11-19 10:34:17 -0800 |
|---|---|---|
| committer | Android (Google) Code Review <android-gerrit@google.com> | 2010-11-19 10:34:17 -0800 |
| commit | 44138f15cef6cfc84686f39227cf61062eb7817e (patch) | |
| tree | 4764509ba959e1c3109463ad1be75f1cc556b463 /wifi/java/android/net | |
| parent | 978ba938421f4e0e73d7c608d6ecbafa4368eb1d (diff) | |
| parent | 434203a277cd2f237a71508a3d5a7d1602126cd5 (diff) | |
| download | frameworks_base-44138f15cef6cfc84686f39227cf61062eb7817e.zip frameworks_base-44138f15cef6cfc84686f39227cf61062eb7817e.tar.gz frameworks_base-44138f15cef6cfc84686f39227cf61062eb7817e.tar.bz2 | |
Merge "Notify all VMs when proxy changes."
Diffstat (limited to 'wifi/java/android/net')
| -rw-r--r-- | wifi/java/android/net/wifi/WifiConfigStore.java | 47 |
1 files changed, 8 insertions, 39 deletions
diff --git a/wifi/java/android/net/wifi/WifiConfigStore.java b/wifi/java/android/net/wifi/WifiConfigStore.java index 04b3891..24f6f31 100644 --- a/wifi/java/android/net/wifi/WifiConfigStore.java +++ b/wifi/java/android/net/wifi/WifiConfigStore.java @@ -595,9 +595,9 @@ class WifiConfigStore { out.writeUTF(PROXY_SETTINGS_KEY); out.writeUTF(config.proxySettings.toString()); out.writeUTF(PROXY_HOST_KEY); - out.writeUTF(proxyProperties.getSocketAddress().getHostName()); + out.writeUTF(proxyProperties.getHost()); out.writeUTF(PROXY_PORT_KEY); - out.writeInt(proxyProperties.getSocketAddress().getPort()); + out.writeInt(proxyProperties.getPort()); out.writeUTF(EXCLUSION_LIST_KEY); out.writeUTF(exclusionList); writeToFile = true; @@ -716,10 +716,8 @@ class WifiConfigStore { switch (proxySettings) { case STATIC: config.proxySettings = proxySettings; - ProxyProperties proxyProperties = new ProxyProperties(); - proxyProperties.setSocketAddress( - new InetSocketAddress(proxyHost, proxyPort)); - proxyProperties.setExclusionList(exclusionList); + ProxyProperties proxyProperties = + new ProxyProperties(proxyHost, proxyPort, exclusionList); linkProperties.setHttpProxy(proxyProperties); break; case NONE: @@ -1012,42 +1010,13 @@ class WifiConfigStore { switch (newConfig.proxySettings) { case STATIC: - InetSocketAddress newSockAddr = null; - String newExclusionList = null; - InetSocketAddress currentSockAddr = null; - String currentExclusionList = null; - ProxyProperties newHttpProxy = newConfig.linkProperties.getHttpProxy(); - if (newHttpProxy != null) { - newSockAddr = newHttpProxy.getSocketAddress(); - newExclusionList = newHttpProxy.getExclusionList(); - } - ProxyProperties currentHttpProxy = currentConfig.linkProperties.getHttpProxy(); - if (currentHttpProxy != null) { - currentSockAddr = currentHttpProxy.getSocketAddress(); - currentExclusionList = currentHttpProxy.getExclusionList(); - } - - boolean socketAddressDiffers = false; - boolean exclusionListDiffers = false; - if (newSockAddr != null && currentSockAddr != null ) { - socketAddressDiffers = !currentSockAddr.equals(newSockAddr); - } else if (newSockAddr != null || currentSockAddr != null) { - socketAddressDiffers = true; - } - - if (newExclusionList != null && currentExclusionList != null) { - exclusionListDiffers = !currentExclusionList.equals(newExclusionList); - } else if (newExclusionList != null || currentExclusionList != null) { - exclusionListDiffers = true; - } - - if ((currentConfig.proxySettings != newConfig.proxySettings) || - socketAddressDiffers || - exclusionListDiffers) { - proxyChanged = true; + if (newHttpProxy != null) { + proxyChanged = !newHttpProxy.equals(currentHttpProxy); + } else { + proxyChanged = (currentHttpProxy != null); } break; case NONE: |
