diff options
author | Irfan Sheriff <isheriff@google.com> | 2010-11-15 14:33:21 -0800 |
---|---|---|
committer | Irfan Sheriff <isheriff@google.com> | 2010-12-01 09:52:32 -0800 |
commit | e142eb0c24b0757343fb0f8cd9e21cacd444a880 (patch) | |
tree | bb260e70234091e4c601e8bdd024394fc04b3ffd /wifi | |
parent | 30c818444d876dd868b84adec2416308c90f32e3 (diff) | |
download | frameworks_base-e142eb0c24b0757343fb0f8cd9e21cacd444a880.zip frameworks_base-e142eb0c24b0757343fb0f8cd9e21cacd444a880.tar.gz frameworks_base-e142eb0c24b0757343fb0f8cd9e21cacd444a880.tar.bz2 |
DO NOT MERGE Fix status fetch from supplicant
Bug: 3192891
Change-Id: I2471f144494d398fe1d4572ac4d6421c100693e2
Diffstat (limited to 'wifi')
-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 a0e588d..1284072 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); |