summaryrefslogtreecommitdiffstats
path: root/packages/SystemUI
diff options
context:
space:
mode:
authorIrfan Sheriff <isheriff@google.com>2012-01-27 21:00:19 -0800
committerIrfan Sheriff <isheriff@google.com>2012-02-29 17:33:36 -0800
commit07573b32494acbabd21979d8b9584c1ed3f7a6ad (patch)
treead3a4a15c889b4b175717cd38a28a92601ed82ae /packages/SystemUI
parent6b48f088b1e0bed242118422c88fea8d714307e0 (diff)
downloadframeworks_base-07573b32494acbabd21979d8b9584c1ed3f7a6ad.zip
frameworks_base-07573b32494acbabd21979d8b9584c1ed3f7a6ad.tar.gz
frameworks_base-07573b32494acbabd21979d8b9584c1ed3f7a6ad.tar.bz2
Improve Wi-Fi hand-off
When Wi-fi connects at L2 layer, the beacons reach and the device can maintain a connection to the access point, but the application connectivity can be flaky (due to bigger packet size exchange). We now use Watchdog to monitor the quality of the last hop on Wi-Fi using signal strength and ARP connectivity as indicators to decide if the link is good enough to switch to Wi-Fi as the uplink. ARP pings are useful for link validation but can still get through when the application traffic fails to go through and thus not best indicator real packet loss since they are tiny packets (28 bytes) and have much low chance of packet corruption than the regular data packets. Signal strength and ARP used together ends up working well in tests. The goal is to switch to Wi-Fi after validating ARP transfer and RSSI and then switching out of Wi-Fi when we hit a low signal strength threshold and waiting until the signal strength improves and validating ARP transfer. Change-Id: Ica593291ec7772da892f03cf45b649635b730c47
Diffstat (limited to 'packages/SystemUI')
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkController.java15
1 files changed, 4 insertions, 11 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkController.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkController.java
index c59290c..95704f6 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkController.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkController.java
@@ -203,7 +203,7 @@ public class NetworkController extends BroadcastReceiver {
mWifiManager = (WifiManager) context.getSystemService(Context.WIFI_SERVICE);
Handler handler = new WifiHandler();
mWifiChannel = new AsyncChannel();
- Messenger wifiMessenger = mWifiManager.getMessenger();
+ Messenger wifiMessenger = mWifiManager.getWifiServiceMessenger();
if (wifiMessenger != null) {
mWifiChannel.connect(mContext, handler, wifiMessenger);
}
@@ -767,17 +767,10 @@ public class NetworkController extends BroadcastReceiver {
} else if (!mWifiConnected) {
mWifiSsid = null;
}
- // Apparently the wifi level is not stable at this point even if we've just connected to
- // the network; we need to wait for an RSSI_CHANGED_ACTION for that. So let's just set
- // it to 0 for now
- mWifiLevel = 0;
- mWifiRssi = -200;
} else if (action.equals(WifiManager.RSSI_CHANGED_ACTION)) {
- if (mWifiConnected) {
- mWifiRssi = intent.getIntExtra(WifiManager.EXTRA_NEW_RSSI, -200);
- mWifiLevel = WifiManager.calculateSignalLevel(
- mWifiRssi, WifiIcons.WIFI_LEVEL_COUNT);
- }
+ mWifiRssi = intent.getIntExtra(WifiManager.EXTRA_NEW_RSSI, -200);
+ mWifiLevel = WifiManager.calculateSignalLevel(
+ mWifiRssi, WifiIcons.WIFI_LEVEL_COUNT);
}
updateWifiIcons();