diff options
| -rw-r--r-- | wifi/java/android/net/wifi/WifiStateTracker.java | 48 |
1 files changed, 24 insertions, 24 deletions
diff --git a/wifi/java/android/net/wifi/WifiStateTracker.java b/wifi/java/android/net/wifi/WifiStateTracker.java index a0e588d3f33d..1284072a20ac 100644 --- a/wifi/java/android/net/wifi/WifiStateTracker.java +++ b/wifi/java/android/net/wifi/WifiStateTracker.java @@ -1461,34 +1461,34 @@ public class WifiStateTracker extends NetworkStateTracker { } private void requestConnectionStatus(WifiInfo info) { - String reply = status(); - if (reply == null) { - return; - } - /* - * 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 - * "name=value". - */ String SSID = null; String BSSID = null; String suppState = null; int netId = -1; - String[] lines = reply.split("\n"); - for (String line : lines) { - String[] prop = line.split(" *= *"); - if (prop.length < 2) - continue; - String name = prop[0]; - String value = prop[1]; - if (name.equalsIgnoreCase("id")) - netId = Integer.parseInt(value); - else if (name.equalsIgnoreCase("ssid")) - SSID = value; - else if (name.equalsIgnoreCase("bssid")) - BSSID = value; - else if (name.equalsIgnoreCase("wpa_state")) - suppState = value; + String reply = status(); + if (reply != null) { + /* + * 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 + * "name=value". + */ + + String[] lines = reply.split("\n"); + for (String line : lines) { + String[] prop = line.split(" *= *"); + if (prop.length < 2) + continue; + String name = prop[0]; + String value = prop[1]; + if (name.equalsIgnoreCase("id")) + netId = Integer.parseInt(value); + else if (name.equalsIgnoreCase("ssid")) + SSID = value; + else if (name.equalsIgnoreCase("bssid")) + BSSID = value; + else if (name.equalsIgnoreCase("wpa_state")) + suppState = value; + } } info.setNetworkId(netId); info.setSSID(SSID); |