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

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

Wifi: Moved setting the Wiif State to ENABLING/DISABLING in the if-else condition.

Earlier it was before the if condition because of that the
previous wifi statewas overwritten. previous wifi state is required to
disable the wifi only ifit was enabled earlier.

CRs-Fixed: 191491
parent 065bf0a4
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -326,10 +326,10 @@ public class WifiService extends IWifiManager.Stub {
        if (enable && isAirplaneModeOn() && !mAirplaneModeOverwridden) {
            return false;
        }
        setWifiEnabledState(enable ? WIFI_STATE_ENABLING : WIFI_STATE_DISABLING, uid);


        if (enable) {
            setWifiEnabledState(WIFI_STATE_ENABLING, uid);
            if (!WifiNative.loadDriver()) {
                Log.e(TAG, "Failed to load Wi-Fi driver.");
                setWifiEnabledState(WIFI_STATE_UNKNOWN, uid);
@@ -344,6 +344,7 @@ public class WifiService extends IWifiManager.Stub {
            registerForBroadcasts();
            mWifiStateTracker.startEventLoop();
        } else if (mWifiState == WIFI_STATE_ENABLED) {
            setWifiEnabledState(WIFI_STATE_DISABLING, uid);

            mContext.unregisterReceiver(mReceiver);
           // Remove notification (it will no-op if it isn't visible)