mLastNetworkId = WifiConfiguration.INVALID_NETWORK_ID;
}
<<<<<<< HEAD
private boolean startSoftApWithConfig(WifiConfiguration config, int currentStatus) {
=======
void handlePreDhcpSetup() {
if (!mBluetoothConnectionActive) {
/*
* There are problems setting the Wi-Fi driver's power
* mode to active when bluetooth coexistence mode is
* enabled or sense.
*
* We set Wi-Fi to active mode when
* obtaining an IP address because we've found
* compatibility issues with some routers with low power
* mode.
*
* In order for this active power mode to properly be set,
* we disable coexistence mode until we're done with
* obtaining an IP address. One exception is if we
* are currently connected to a headset, since disabling
* coexistence would interrupt that connection.
*/
// Disable the coexistence mode
WifiNative.setBluetoothCoexistenceModeCommand(
WifiNative.BLUETOOTH_COEXISTENCE_MODE_DISABLED);
}
mPowerMode = WifiNative.getPowerModeCommand();
if (mPowerMode < 0) {
// Handle the case where supplicant driver does not support
// getPowerModeCommand.
mPowerMode = WifiStateMachine.POWER_MODE_AUTO;
}
if (mPowerMode != WifiStateMachine.POWER_MODE_ACTIVE) {
WifiNative.setPowerModeCommand(WifiStateMachine.POWER_MODE_ACTIVE);
}
}
void handlePostDhcpSetup() {
/* restore power mode */
WifiNative.setPowerModeCommand(mPowerMode);
// Set the coexistence mode back to its default value
WifiNative.setBluetoothCoexistenceModeCommand(
WifiNative.BLUETOOTH_COEXISTENCE_MODE_SENSE);
}
private void handleSuccessfulIpConfiguration(DhcpInfoInternal dhcpInfoInternal) {
synchronized (mDhcpInfoInternal) {
mDhcpInfoInternal = dhcpInfoInternal;
}
mLastSignalLevel = -1; // force update of signal strength
WifiConfigStore.setIpConfiguration(mLastNetworkId, dhcpInfoInternal);
InetAddress addr = NetworkUtils.numericToInetAddress(dhcpInfoInternal.ipAddress);
mWifiInfo.setInetAddress(addr);
if (getNetworkDetailedState() == DetailedState.CONNECTED) {
//DHCP renewal in connected state
LinkProperties linkProperties = dhcpInfoInternal.makeLinkProperties();
linkProperties.setHttpProxy(WifiConfigStore.getProxyProperties(mLastNetworkId));
linkProperties.setInterfaceName(mInterfaceName);
if (!linkProperties.equals(mLinkProperties)) {
Log.d(TAG, "Link configuration changed for netId: " + mLastNetworkId
+ " old: " + mLinkProperties + "new: " + linkProperties);
NetworkUtils.resetConnections(mInterfaceName);
mLinkProperties = linkProperties;
sendLinkConfigurationChangedBroadcast();
}
} else {
configureLinkProperties();
setNetworkDetailedState(DetailedState.CONNECTED);
sendNetworkStateChangeBroadcast(mLastBssid);
}
}
private void handleFailedIpConfiguration() {
Log.e(TAG, "IP configuration failed");
mWifiInfo.setInetAddress(null);
/**
* If we've exceeded the maximum number of retries for DHCP
* to a given network, disable the network
*/
if (++mReconnectCount > getMaxDhcpRetries()) {
Log.e(TAG, "Failed " +
mReconnectCount + " times, Disabling " + mLastNetworkId);
WifiConfigStore.disableNetwork(mLastNetworkId);
mReconnectCount = 0;
}
/* DHCP times out after about 30 seconds, we do a
* disconnect and an immediate reconnect to try again
*/
WifiNative.disconnectCommand();
WifiNative.reconnectCommand();
}
private boolean startSoftApWithConfig(WifiConfiguration config, int currentStatus) {
>>>>>>> 914ed90f2c02092474d2db36626734ca1b2cf315
if (config == null) {
config = WifiApConfigStore.getApConfiguration();
} else { |