Merge "update current config with dhcp settings"

This commit is contained in:
Irfan Sheriff
2011-03-03 14:39:59 -08:00
committed by Android (Google) Code Review
2 changed files with 20 additions and 0 deletions

View File

@@ -460,6 +460,25 @@ class WifiConfigStore {
return dhcpInfoInternal;
}
/**
* set IP configuration for a given network id
*/
static void setIpConfiguration(int netId, DhcpInfoInternal dhcpInfo) {
LinkProperties linkProperties = dhcpInfo.makeLinkProperties();
synchronized (sConfiguredNetworks) {
WifiConfiguration config = sConfiguredNetworks.get(netId);
if (config != null) {
// add old proxy details
if(config.linkProperties != null) {
linkProperties.setHttpProxy(config.linkProperties.getHttpProxy());
}
config.linkProperties = linkProperties;
}
}
}
/**
* Fetch the proxy properties for a given network id
*/

View File

@@ -2510,6 +2510,7 @@ public class WifiStateMachine extends HierarchicalStateMachine {
synchronized (mDhcpInfoInternal) {
mDhcpInfoInternal = dhcpInfoInternal;
}
WifiConfigStore.setIpConfiguration(mLastNetworkId, dhcpInfoInternal);
sendMessage(CMD_IP_CONFIG_SUCCESS);
} else {
Log.d(TAG, "DHCP request failed: " +