WifiService: use wifi association state to determine if we should suspend wifi instead of

the existance of an IP address.

Signed-off-by: San Mehat <san@google.com>
This commit is contained in:
San Mehat
2009-07-07 09:34:44 -07:00
parent 88e209dcf8
commit fa6c7111fe

View File

@@ -1569,8 +1569,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 {