The Settings app is listening to wpa_supplicant state change so as to update the state of the AccessPoint objects and present Wifi state to the user.

This is not right because wpa_supplicant states are transient (for instance when the WiFi Layer, at Layer 2, is going thru some harmless spurious disconnection cycle due to WiFi signal fluctuation). This cause the state of the WiFi Network to appear to be unstable to the user.

Hence, I removed dependencies on wpa_supplicant internal state.

In addition so as to improve debugging, I added the BSSID to the Wifi Verbose Logging string which is shown in wifi picker alongside the current network. This string only appear when a user goes into Developper Options and enable WiFi Verbose Logging.

The below bug is an example of situation where a spurious disconnect (a coupld seconds) handled by wpa_supplicant can cause the WiFi Settings to indicate that the link is unstable.

Bug:16140888 Wifi best network selection not smooth


Change-Id: I0e7c6b86262b88ed993c46fcdcdbab4d9b1f5ea1
This commit is contained in:
vandwalle
2014-07-31 00:06:40 -07:00
committed by Pierre Vandwalle
parent d94e78b4b2
commit 3b5e4e2421
2 changed files with 4 additions and 27 deletions

View File

@@ -427,17 +427,12 @@ class AccessPoint extends Preference {
StringBuilder visibility = new StringBuilder();
long now = System.currentTimeMillis();
long age = (now - mSeen);
if (age < VISIBILITY_MAX_AGE_IN_MILLI) {
//show age in seconds, in the form xx
visibility.append(Long.toString((age / SECOND_TO_MILLI) % SECOND_TO_MILLI))
.append("s");
} else {
//not seen for more than 1000 seconds
visibility.append("!");
}
if (mInfo != null) {
String bssid = mInfo.getBSSID();
if (bssid != null) {
visibility.append(" ").append(bssid);
}
visibility.append(" sc=").append(Integer.toString(mInfo.score));
visibility.append(" ");
visibility.append(String.format("tx=%.1f,", mInfo.txSuccessRate));