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

Commit 065bf0a4 authored by Agarwal, Shirish Kumar's avatar Agarwal, Shirish Kumar Committed by Steve Kondik
Browse files

Wifi: Corrected the else condition

Disable the wifi only when it was previously enabled.

CRs-Fixed: 183294
parent 873b6c20
Loading
Loading
Loading
Loading
+2 −6
Original line number Diff line number Diff line
@@ -326,10 +326,7 @@ public class WifiService extends IWifiManager.Stub {
        if (enable && isAirplaneModeOn() && !mAirplaneModeOverwridden) {
            return false;
        }
        if (mWifiState == WIFI_STATE_UNKNOWN) {
        setWifiEnabledState(enable ? WIFI_STATE_ENABLING : WIFI_STATE_DISABLING, uid);
            return false;
        }


        if (enable) {
@@ -346,7 +343,7 @@ public class WifiService extends IWifiManager.Stub {
            }
            registerForBroadcasts();
            mWifiStateTracker.startEventLoop();
        } else if (mWifiState != WIFI_STATE_DISABLING) {
        } else if (mWifiState == WIFI_STATE_ENABLED) {

            mContext.unregisterReceiver(mReceiver);
           // Remove notification (it will no-op if it isn't visible)
@@ -377,7 +374,6 @@ public class WifiService extends IWifiManager.Stub {
            return true;
        }

        setWifiEnabledState(enable ? WIFI_STATE_ENABLING : WIFI_STATE_DISABLING, uid);
        // Success!

        if (persist) {