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

Commit 9a737639 authored by Irfan Sheriff's avatar Irfan Sheriff Committed by Android (Google) Code Review
Browse files

Merge "Clear network id when invalid" into honeycomb-LTE

parents 6e5cdca1 0a8bd60a
Loading
Loading
Loading
Loading
+12 −8
Original line number Diff line number Diff line
@@ -481,7 +481,7 @@ public class WifiStateMachine extends StateMachine {
        mNetworkInfo.setIsAvailable(false);
        mLinkProperties.clear();
        mLastBssid = null;
        mLastNetworkId = -1;
        mLastNetworkId = WifiConfiguration.INVALID_NETWORK_ID;
        mLastSignalLevel = -1;

        mAlarmManager = (AlarmManager)mContext.getSystemService(Context.ALARM_SERVICE);
@@ -821,11 +821,12 @@ public class WifiStateMachine extends StateMachine {
    }

    public void connectNetwork(WifiConfiguration wifiConfig) {
        /* arg1 is used to indicate netId, force a netId value of -1 when
         * we are passing a configuration since the default value of
         * 0 is a valid netId
        /* arg1 is used to indicate netId, force a netId value of
         * WifiConfiguration.INVALID_NETWORK_ID when we are passing
         * a configuration since the default value of 0 is a valid netId
         */
        sendMessage(obtainMessage(CMD_CONNECT_NETWORK, -1, 0, wifiConfig));
        sendMessage(obtainMessage(CMD_CONNECT_NETWORK, WifiConfiguration.INVALID_NETWORK_ID,
                0, wifiConfig));
    }

    public void saveNetwork(WifiConfiguration wifiConfig) {
@@ -1429,7 +1430,7 @@ public class WifiStateMachine extends StateMachine {
        mWifiInfo.setInetAddress(null);
        mWifiInfo.setBSSID(null);
        mWifiInfo.setSSID(null);
        mWifiInfo.setNetworkId(-1);
        mWifiInfo.setNetworkId(WifiConfiguration.INVALID_NETWORK_ID);
        mWifiInfo.setRssi(MIN_RSSI);
        mWifiInfo.setLinkSpeed(-1);

@@ -1441,7 +1442,7 @@ public class WifiStateMachine extends StateMachine {
        mLinkProperties.clear();

        mLastBssid= null;
        mLastNetworkId = -1;
        mLastNetworkId = WifiConfiguration.INVALID_NETWORK_ID;

    }

@@ -2034,7 +2035,7 @@ public class WifiStateMachine extends StateMachine {
                    mWpsStateMachine.sendMessage(CMD_RESET_WPS_STATE);
                    /* Initialize data structures */
                    mLastBssid = null;
                    mLastNetworkId = -1;
                    mLastNetworkId = WifiConfiguration.INVALID_NETWORK_ID;
                    mLastSignalLevel = -1;

                    mWifiInfo.setMacAddress(WifiNative.getMacAddressCommand());
@@ -2524,7 +2525,10 @@ public class WifiStateMachine extends StateMachine {
                    // Network id is only valid when we start connecting
                    if (SupplicantState.isConnecting(state)) {
                        mWifiInfo.setNetworkId(stateChangeResult.networkId);
                    } else {
                        mWifiInfo.setNetworkId(WifiConfiguration.INVALID_NETWORK_ID);
                    }

                    if (state == SupplicantState.ASSOCIATING) {
                        /* BSSID is valid only in ASSOCIATING state */
                        mWifiInfo.setBSSID(stateChangeResult.BSSID);