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

Commit 1af1371e authored by Nick Vaccaro's avatar Nick Vaccaro Committed by Android Git Automerger
Browse files

am 117df282: Don\'t grab wakelock if Wifi feature not supported on device

* commit '117df282':
  Don't grab wakelock if Wifi feature not supported on device
parents e5b73ae2 117df282
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -118,6 +118,7 @@ public class WifiStateMachine extends StateMachine {
    private INetworkManagementService mNwService;
    private ConnectivityManager mCm;

    private final boolean mWifiSupported;
    private final boolean mP2pSupported;
    private final AtomicBoolean mP2pConnected = new AtomicBoolean(false);
    private boolean mTemporarilyDisconnectWifi = false;
@@ -658,6 +659,9 @@ public class WifiStateMachine extends StateMachine {
        mP2pSupported = mContext.getPackageManager().hasSystemFeature(
                PackageManager.FEATURE_WIFI_DIRECT);

        mWifiSupported = mContext.getPackageManager().hasSystemFeature(
                PackageManager.FEATURE_WIFI);

        mWifiNative = new WifiNative(mInterfaceName);
        mWifiConfigStore = new WifiConfigStore(context, mWifiNative);
        mWifiMonitor = new WifiMonitor(this, mWifiNative);
@@ -1676,7 +1680,7 @@ public class WifiStateMachine extends StateMachine {
        }

        if (screenOn) enableAllNetworks();
        if (mUserWantsSuspendOpt.get()) {
        if (mWifiSupported && mUserWantsSuspendOpt.get()) {
            if (screenOn) {
                sendMessage(CMD_SET_SUSPEND_OPT_ENABLED, 0, 0);
            } else {