am fa6c7111: WifiService: use wifi association state to determine if we should suspend wifi instead of the existance of an IP address.

Merge commit 'fa6c7111fe58e09a92741c7655221c3629d3220e'

* commit 'fa6c7111fe58e09a92741c7655221c3629d3220e':
  WifiService: use wifi association state to determine if we should suspend wifi instead of
This commit is contained in:
San Mehat
2009-07-07 10:19:56 -07:00
committed by The Android Open Source Project

View File

@@ -1577,8 +1577,9 @@ public class WifiService extends IWifiManager.Stub {
* or plugged in to AC).
*/
if (!shouldWifiStayAwake(stayAwakeConditions, mPluggedType)) {
if (!mWifiStateTracker.hasIpAddress()) {
// do not keep Wifi awake when screen is off if Wifi is not fully active
WifiInfo info = mWifiStateTracker.requestConnectionInfo();
if (info.getSupplicantState() != SupplicantState.COMPLETED) {
// do not keep Wifi awake when screen is off if Wifi is not associated
mDeviceIdle = true;
updateWifiState();
} else {