Loading wifi/java/android/net/wifi/WifiConfigStore.java +11 −4 Original line number Diff line number Diff line Loading @@ -634,6 +634,8 @@ class WifiConfigStore { if (config.priority > mLastPriority) { mLastPriority = config.priority; } config.ipAssignment = IpAssignment.DHCP; config.proxySettings = ProxySettings.NONE; mConfiguredNetworks.put(config.networkId, config); mNetworkIds.put(configKey(config), config.networkId); } Loading Loading @@ -831,8 +833,9 @@ class WifiConfigStore { while (true) { int id = -1; IpAssignment ipAssignment = IpAssignment.UNASSIGNED; ProxySettings proxySettings = ProxySettings.UNASSIGNED; // Default is DHCP with no proxy IpAssignment ipAssignment = IpAssignment.DHCP; ProxySettings proxySettings = ProxySettings.NONE; LinkProperties linkProperties = new LinkProperties(); String proxyHost = null; int proxyPort = -1; Loading Loading @@ -902,7 +905,8 @@ class WifiConfigStore { config.ipAssignment = ipAssignment; break; case UNASSIGNED: //Ignore loge("BUG: Found UNASSIGNED IP on file, use DHCP"); config.ipAssignment = IpAssignment.DHCP; break; default: loge("Ignore invalid ip assignment while reading"); Loading @@ -920,7 +924,8 @@ class WifiConfigStore { config.proxySettings = proxySettings; break; case UNASSIGNED: //Ignore loge("BUG: Found UNASSIGNED proxy on file, use NONE"); config.proxySettings = ProxySettings.NONE; break; default: loge("Ignore invalid proxy settings while reading"); Loading Loading @@ -1176,6 +1181,8 @@ class WifiConfigStore { WifiConfiguration currentConfig = mConfiguredNetworks.get(netId); if (currentConfig == null) { currentConfig = new WifiConfiguration(); currentConfig.ipAssignment = IpAssignment.DHCP; currentConfig.proxySettings = ProxySettings.NONE; currentConfig.networkId = netId; } Loading wifi/java/android/net/wifi/WifiStateMachine.java +23 −18 Original line number Diff line number Diff line Loading @@ -1648,15 +1648,7 @@ public class WifiStateMachine extends StateMachine { private void handleNetworkDisconnect() { if (DBG) log("Stopping DHCP and clearing IP"); /* * stop DHCP */ if (mDhcpStateMachine != null) { /* In case we were in middle of DHCP operation restore back powermode */ handlePostDhcpSetup(); mDhcpStateMachine.sendMessage(DhcpStateMachine.CMD_STOP_DHCP); } stopDhcp(); try { mNwService.clearInterfaceAddresses(mInterfaceName); Loading Loading @@ -1734,6 +1726,24 @@ public class WifiStateMachine extends StateMachine { } void startDhcp() { if (mDhcpStateMachine == null) { mDhcpStateMachine = DhcpStateMachine.makeDhcpStateMachine( mContext, WifiStateMachine.this, mInterfaceName); } mDhcpStateMachine.registerForPreDhcpNotification(); mDhcpStateMachine.sendMessage(DhcpStateMachine.CMD_START_DHCP); } void stopDhcp() { if (mDhcpStateMachine != null) { /* In case we were in middle of DHCP operation restore back powermode */ handlePostDhcpSetup(); mDhcpStateMachine.sendMessage(DhcpStateMachine.CMD_STOP_DHCP); } } void handlePostDhcpSetup() { /* Restore power save and suspend optimizations */ setSuspendOptimizationsNative(SUSPEND_DUE_TO_DHCP, true); Loading @@ -1751,7 +1761,7 @@ public class WifiStateMachine extends StateMachine { mDhcpResults = dhcpResults; } LinkProperties linkProperties = dhcpResults.linkProperties; mWifiConfigStore.setLinkProperties(mLastNetworkId, linkProperties); mWifiConfigStore.setLinkProperties(mLastNetworkId, new LinkProperties(linkProperties)); InetAddress addr = null; Iterator<InetAddress> addrs = linkProperties.getAddresses().iterator(); if (addrs.hasNext()) { Loading Loading @@ -2996,15 +3006,10 @@ public class WifiStateMachine extends StateMachine { @Override public void enter() { if (!mWifiConfigStore.isUsingStaticIp(mLastNetworkId)) { //start DHCP if (mDhcpStateMachine == null) { mDhcpStateMachine = DhcpStateMachine.makeDhcpStateMachine( mContext, WifiStateMachine.this, mInterfaceName); } mDhcpStateMachine.registerForPreDhcpNotification(); mDhcpStateMachine.sendMessage(DhcpStateMachine.CMD_START_DHCP); startDhcp(); } else { // stop any running dhcp before assigning static IP stopDhcp(); DhcpResults dhcpResults = new DhcpResults( mWifiConfigStore.getLinkProperties(mLastNetworkId)); dhcpResults.linkProperties.setInterfaceName(mInterfaceName); Loading Loading
wifi/java/android/net/wifi/WifiConfigStore.java +11 −4 Original line number Diff line number Diff line Loading @@ -634,6 +634,8 @@ class WifiConfigStore { if (config.priority > mLastPriority) { mLastPriority = config.priority; } config.ipAssignment = IpAssignment.DHCP; config.proxySettings = ProxySettings.NONE; mConfiguredNetworks.put(config.networkId, config); mNetworkIds.put(configKey(config), config.networkId); } Loading Loading @@ -831,8 +833,9 @@ class WifiConfigStore { while (true) { int id = -1; IpAssignment ipAssignment = IpAssignment.UNASSIGNED; ProxySettings proxySettings = ProxySettings.UNASSIGNED; // Default is DHCP with no proxy IpAssignment ipAssignment = IpAssignment.DHCP; ProxySettings proxySettings = ProxySettings.NONE; LinkProperties linkProperties = new LinkProperties(); String proxyHost = null; int proxyPort = -1; Loading Loading @@ -902,7 +905,8 @@ class WifiConfigStore { config.ipAssignment = ipAssignment; break; case UNASSIGNED: //Ignore loge("BUG: Found UNASSIGNED IP on file, use DHCP"); config.ipAssignment = IpAssignment.DHCP; break; default: loge("Ignore invalid ip assignment while reading"); Loading @@ -920,7 +924,8 @@ class WifiConfigStore { config.proxySettings = proxySettings; break; case UNASSIGNED: //Ignore loge("BUG: Found UNASSIGNED proxy on file, use NONE"); config.proxySettings = ProxySettings.NONE; break; default: loge("Ignore invalid proxy settings while reading"); Loading Loading @@ -1176,6 +1181,8 @@ class WifiConfigStore { WifiConfiguration currentConfig = mConfiguredNetworks.get(netId); if (currentConfig == null) { currentConfig = new WifiConfiguration(); currentConfig.ipAssignment = IpAssignment.DHCP; currentConfig.proxySettings = ProxySettings.NONE; currentConfig.networkId = netId; } Loading
wifi/java/android/net/wifi/WifiStateMachine.java +23 −18 Original line number Diff line number Diff line Loading @@ -1648,15 +1648,7 @@ public class WifiStateMachine extends StateMachine { private void handleNetworkDisconnect() { if (DBG) log("Stopping DHCP and clearing IP"); /* * stop DHCP */ if (mDhcpStateMachine != null) { /* In case we were in middle of DHCP operation restore back powermode */ handlePostDhcpSetup(); mDhcpStateMachine.sendMessage(DhcpStateMachine.CMD_STOP_DHCP); } stopDhcp(); try { mNwService.clearInterfaceAddresses(mInterfaceName); Loading Loading @@ -1734,6 +1726,24 @@ public class WifiStateMachine extends StateMachine { } void startDhcp() { if (mDhcpStateMachine == null) { mDhcpStateMachine = DhcpStateMachine.makeDhcpStateMachine( mContext, WifiStateMachine.this, mInterfaceName); } mDhcpStateMachine.registerForPreDhcpNotification(); mDhcpStateMachine.sendMessage(DhcpStateMachine.CMD_START_DHCP); } void stopDhcp() { if (mDhcpStateMachine != null) { /* In case we were in middle of DHCP operation restore back powermode */ handlePostDhcpSetup(); mDhcpStateMachine.sendMessage(DhcpStateMachine.CMD_STOP_DHCP); } } void handlePostDhcpSetup() { /* Restore power save and suspend optimizations */ setSuspendOptimizationsNative(SUSPEND_DUE_TO_DHCP, true); Loading @@ -1751,7 +1761,7 @@ public class WifiStateMachine extends StateMachine { mDhcpResults = dhcpResults; } LinkProperties linkProperties = dhcpResults.linkProperties; mWifiConfigStore.setLinkProperties(mLastNetworkId, linkProperties); mWifiConfigStore.setLinkProperties(mLastNetworkId, new LinkProperties(linkProperties)); InetAddress addr = null; Iterator<InetAddress> addrs = linkProperties.getAddresses().iterator(); if (addrs.hasNext()) { Loading Loading @@ -2996,15 +3006,10 @@ public class WifiStateMachine extends StateMachine { @Override public void enter() { if (!mWifiConfigStore.isUsingStaticIp(mLastNetworkId)) { //start DHCP if (mDhcpStateMachine == null) { mDhcpStateMachine = DhcpStateMachine.makeDhcpStateMachine( mContext, WifiStateMachine.this, mInterfaceName); } mDhcpStateMachine.registerForPreDhcpNotification(); mDhcpStateMachine.sendMessage(DhcpStateMachine.CMD_START_DHCP); startDhcp(); } else { // stop any running dhcp before assigning static IP stopDhcp(); DhcpResults dhcpResults = new DhcpResults( mWifiConfigStore.getLinkProperties(mLastNetworkId)); dhcpResults.linkProperties.setInterfaceName(mInterfaceName); Loading