Merge "DO NOT MERGE Fix status fetch from supplicant" into gingerbread

This commit is contained in:
Irfan Sheriff
2010-12-01 10:17:56 -08:00
committed by Android (Google) Code Review

View File

@@ -1461,19 +1461,18 @@ public class WifiStateTracker extends NetworkStateTracker {
} }
private void requestConnectionStatus(WifiInfo info) { private void requestConnectionStatus(WifiInfo info) {
String SSID = null;
String BSSID = null;
String suppState = null;
int netId = -1;
String reply = status(); String reply = status();
if (reply == null) { if (reply != null) {
return;
}
/* /*
* Parse the reply from the supplicant to the status command, and update * Parse the reply from the supplicant to the status command, and update
* local state accordingly. The reply is a series of lines of the form * local state accordingly. The reply is a series of lines of the form
* "name=value". * "name=value".
*/ */
String SSID = null;
String BSSID = null;
String suppState = null;
int netId = -1;
String[] lines = reply.split("\n"); String[] lines = reply.split("\n");
for (String line : lines) { for (String line : lines) {
String[] prop = line.split(" *= *"); String[] prop = line.split(" *= *");
@@ -1490,6 +1489,7 @@ public class WifiStateTracker extends NetworkStateTracker {
else if (name.equalsIgnoreCase("wpa_state")) else if (name.equalsIgnoreCase("wpa_state"))
suppState = value; suppState = value;
} }
}
info.setNetworkId(netId); info.setNetworkId(netId);
info.setSSID(SSID); info.setSSID(SSID);
info.setBSSID(BSSID); info.setBSSID(BSSID);