diff options
author | Mike Lockwood <lockwood@android.com> | 2009-06-25 13:01:12 -0400 |
---|---|---|
committer | Mike Lockwood <lockwood@android.com> | 2009-06-25 13:01:12 -0400 |
commit | 1a645058a85182371b581916deba501feaa7bb86 (patch) | |
tree | 7e1c76937fe7c344a732725806655b573a889346 /services/java/com/android/server/WifiService.java | |
parent | 2383415ab982ff156a85929f58029c0b863750c5 (diff) | |
download | frameworks_base-1a645058a85182371b581916deba501feaa7bb86.zip frameworks_base-1a645058a85182371b581916deba501feaa7bb86.tar.gz frameworks_base-1a645058a85182371b581916deba501feaa7bb86.tar.bz2 |
WifiService: Update all scan result values in our scan result cache.
Previously only the level was being updated, resulting in out of date values
being left in the cache.
Patch was provided by Motorola.
Signed-off-by: Mike Lockwood <lockwood@android.com>
Diffstat (limited to 'services/java/com/android/server/WifiService.java')
-rw-r--r-- | services/java/com/android/server/WifiService.java | 59 |
1 files changed, 31 insertions, 28 deletions
diff --git a/services/java/com/android/server/WifiService.java b/services/java/com/android/server/WifiService.java index 969fbfe..e91798b 100644 --- a/services/java/com/android/server/WifiService.java +++ b/services/java/com/android/server/WifiService.java @@ -1349,39 +1349,42 @@ public class WifiService extends IWifiManager.Stub { level = 0; } - // bssid is the hash key - scanResult = mScanResultCache.get(bssid); - if (scanResult != null) { - scanResult.level = level; - } else { - /* - * The formatting of the results returned by - * wpa_supplicant is intended to make the fields - * line up nicely when printed, - * not to make them easy to parse. So we have to - * apply some heuristics to figure out which field - * is the SSID and which field is the flags. - */ - String ssid; - String flags; - if (result.length == 4) { - if (result[3].charAt(0) == '[') { - flags = result[3]; - ssid = ""; - } else { - flags = ""; - ssid = result[3]; - } - } else if (result.length == 5) { + /* + * The formatting of the results returned by + * wpa_supplicant is intended to make the fields + * line up nicely when printed, + * not to make them easy to parse. So we have to + * apply some heuristics to figure out which field + * is the SSID and which field is the flags. + */ + String ssid; + String flags; + if (result.length == 4) { + if (result[3].charAt(0) == '[') { flags = result[3]; - ssid = result[4]; + ssid = ""; } else { - // Here, we must have 3 fields: no flags and ssid - // set flags = ""; - ssid = ""; + ssid = result[3]; } + } else if (result.length == 5) { + flags = result[3]; + ssid = result[4]; + } else { + // Here, we must have 3 fields: no flags and ssid + // set + flags = ""; + ssid = ""; + } + // bssid is the hash key + scanResult = mScanResultCache.get(bssid); + if (scanResult != null) { + scanResult.level = level; + scanResult.SSID = ssid; + scanResult.capabilities = flags; + scanResult.frequency = frequency; + } else { // Do not add scan results that have no SSID set if (0 < ssid.trim().length()) { scanResult = |