diff options
author | Irfan Sheriff <isheriff@google.com> | 2011-06-08 17:31:58 -0700 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2011-06-08 17:31:58 -0700 |
commit | dd65ed25c47acf5d551f56a232e1656f2f8c3483 (patch) | |
tree | 509318139505e9cfa32d270dee43fb4bb0314302 /wifi/java/android | |
parent | e6510eb9352e75f9b2dc63396d790dff9abbb1f8 (diff) | |
parent | 92593dc49b348c4951037a1ae2fa17bb6644ffb9 (diff) | |
download | frameworks_base-dd65ed25c47acf5d551f56a232e1656f2f8c3483.zip frameworks_base-dd65ed25c47acf5d551f56a232e1656f2f8c3483.tar.gz frameworks_base-dd65ed25c47acf5d551f56a232e1656f2f8c3483.tar.bz2 |
am 92593dc4: am 84db79bb: Merge "Clear IP configuration on lost network" into honeycomb-LTE
* commit '92593dc49b348c4951037a1ae2fa17bb6644ffb9':
Clear IP configuration on lost network
Diffstat (limited to 'wifi/java/android')
-rw-r--r-- | wifi/java/android/net/wifi/WifiConfigStore.java | 15 | ||||
-rw-r--r-- | wifi/java/android/net/wifi/WifiStateMachine.java | 5 |
2 files changed, 19 insertions, 1 deletions
diff --git a/wifi/java/android/net/wifi/WifiConfigStore.java b/wifi/java/android/net/wifi/WifiConfigStore.java index 7f9fc31..d83b968 100644 --- a/wifi/java/android/net/wifi/WifiConfigStore.java +++ b/wifi/java/android/net/wifi/WifiConfigStore.java @@ -478,6 +478,21 @@ class WifiConfigStore { } } + /** + * clear IP configuration for a given network id + */ + static void clearIpConfiguration(int netId) { + synchronized (sConfiguredNetworks) { + WifiConfiguration config = sConfiguredNetworks.get(netId); + if (config != null && config.linkProperties != null) { + // Clear everything except proxy + ProxyProperties proxy = config.linkProperties.getHttpProxy(); + config.linkProperties.clear(); + config.linkProperties.setHttpProxy(proxy); + } + } + } + /** * Fetch the proxy properties for a given network id diff --git a/wifi/java/android/net/wifi/WifiStateMachine.java b/wifi/java/android/net/wifi/WifiStateMachine.java index bd6da64..5307070 100644 --- a/wifi/java/android/net/wifi/WifiStateMachine.java +++ b/wifi/java/android/net/wifi/WifiStateMachine.java @@ -1456,10 +1456,13 @@ public class WifiStateMachine extends StateMachine { /* Clear network properties */ mLinkProperties.clear(); + /* Clear IP settings if the network used DHCP */ + if (!WifiConfigStore.isUsingStaticIp(mLastNetworkId)) { + WifiConfigStore.clearIpConfiguration(mLastNetworkId); + } mLastBssid= null; mLastNetworkId = WifiConfiguration.INVALID_NETWORK_ID; - } void handlePreDhcpSetup() { |