diff options
author | San Mehat <san@google.com> | 2009-07-07 09:34:44 -0700 |
---|---|---|
committer | San Mehat <san@google.com> | 2009-07-07 09:41:39 -0700 |
commit | fa6c7111fe58e09a92741c7655221c3629d3220e (patch) | |
tree | 6db4f252f5e22c8820aff82c149860f224b50f8e /services | |
parent | 88e209dcf8c2ebddda5c272f46d1bd5478bc639c (diff) | |
download | frameworks_base-fa6c7111fe58e09a92741c7655221c3629d3220e.zip frameworks_base-fa6c7111fe58e09a92741c7655221c3629d3220e.tar.gz frameworks_base-fa6c7111fe58e09a92741c7655221c3629d3220e.tar.bz2 |
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>
Diffstat (limited to 'services')
-rw-r--r-- | services/java/com/android/server/WifiService.java | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/services/java/com/android/server/WifiService.java b/services/java/com/android/server/WifiService.java index e2aee42..5cbe7f3 100644 --- a/services/java/com/android/server/WifiService.java +++ b/services/java/com/android/server/WifiService.java @@ -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 { |