summaryrefslogtreecommitdiffstats
path: root/wifi/java/android
diff options
context:
space:
mode:
authorIrfan Sheriff <isheriff@google.com>2011-05-24 19:53:04 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2011-05-24 19:53:04 -0700
commitd57f5067e6465f18dfb27eaf0454a65d28ce1548 (patch)
tree07379155f2d380846f33d2febf6483e4ad37b26c /wifi/java/android
parent8f40e5871213afb63ae4b68a44dd09e0a014e417 (diff)
parentc2ff0e7031b54810d26e1d2a1ba9cdb529f25306 (diff)
downloadframeworks_base-d57f5067e6465f18dfb27eaf0454a65d28ce1548.zip
frameworks_base-d57f5067e6465f18dfb27eaf0454a65d28ce1548.tar.gz
frameworks_base-d57f5067e6465f18dfb27eaf0454a65d28ce1548.tar.bz2
am c2ff0e70: am 9a737639: Merge "Clear network id when invalid" into honeycomb-LTE
* commit 'c2ff0e7031b54810d26e1d2a1ba9cdb529f25306': Clear network id when invalid
Diffstat (limited to 'wifi/java/android')
-rw-r--r--wifi/java/android/net/wifi/WifiStateMachine.java20
1 files changed, 12 insertions, 8 deletions
diff --git a/wifi/java/android/net/wifi/WifiStateMachine.java b/wifi/java/android/net/wifi/WifiStateMachine.java
index 134f29f..bd6da64 100644
--- a/wifi/java/android/net/wifi/WifiStateMachine.java
+++ b/wifi/java/android/net/wifi/WifiStateMachine.java
@@ -491,7 +491,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);
@@ -837,11 +837,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) {
@@ -1445,7 +1446,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);
@@ -1457,7 +1458,7 @@ public class WifiStateMachine extends StateMachine {
mLinkProperties.clear();
mLastBssid= null;
- mLastNetworkId = -1;
+ mLastNetworkId = WifiConfiguration.INVALID_NETWORK_ID;
}
@@ -2050,7 +2051,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());
@@ -2545,7 +2546,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);