Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fa6c7111 authored by San Mehat's avatar San Mehat
Browse files

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


the existance of an IP address.

Signed-off-by: default avatarSan Mehat <san@google.com>
parent 88e209dc
Loading
Loading
Loading
Loading
+3 −2
Original line number Original line Diff line number Diff line
@@ -1569,8 +1569,9 @@ public class WifiService extends IWifiManager.Stub {
                 * or plugged in to AC).
                 * or plugged in to AC).
                 */
                 */
                if (!shouldWifiStayAwake(stayAwakeConditions, mPluggedType)) {
                if (!shouldWifiStayAwake(stayAwakeConditions, mPluggedType)) {
                    if (!mWifiStateTracker.hasIpAddress()) {
                    WifiInfo info = mWifiStateTracker.requestConnectionInfo();
                        // do not keep Wifi awake when screen is off if Wifi is not fully active
                    if (info.getSupplicantState() != SupplicantState.COMPLETED) {
                        // do not keep Wifi awake when screen is off if Wifi is not associated
                        mDeviceIdle = true;
                        mDeviceIdle = true;
                        updateWifiState();
                        updateWifiState();
                    } else {
                    } else {