Merge "Clear IP configuration on lost network" into honeycomb-LTE
This commit is contained in:
committed by
Android (Google) Code Review
commit
84db79bb65
@@ -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
|
* Fetch the proxy properties for a given network id
|
||||||
|
|||||||
@@ -1440,10 +1440,13 @@ public class WifiStateMachine extends StateMachine {
|
|||||||
|
|
||||||
/* Clear network properties */
|
/* Clear network properties */
|
||||||
mLinkProperties.clear();
|
mLinkProperties.clear();
|
||||||
|
/* Clear IP settings if the network used DHCP */
|
||||||
|
if (!WifiConfigStore.isUsingStaticIp(mLastNetworkId)) {
|
||||||
|
WifiConfigStore.clearIpConfiguration(mLastNetworkId);
|
||||||
|
}
|
||||||
|
|
||||||
mLastBssid= null;
|
mLastBssid= null;
|
||||||
mLastNetworkId = WifiConfiguration.INVALID_NETWORK_ID;
|
mLastNetworkId = WifiConfiguration.INVALID_NETWORK_ID;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void handlePreDhcpSetup() {
|
void handlePreDhcpSetup() {
|
||||||
|
|||||||
Reference in New Issue
Block a user