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
This commit is contained in:
Irfan Sheriff
2012-01-27 21:00:19 -08:00
parent 6b48f088b1
commit 07573b3249
11 changed files with 703 additions and 847 deletions

View File

@ -914,7 +914,7 @@ public class WifiService extends IWifiManager.Stub {
* Get a reference to handler. This is used by a client to establish
* an AsyncChannel communication with WifiService
*/
public Messenger getMessenger() {
public Messenger getWifiServiceMessenger() {
/* Enforce the highest permissions
TODO: when we consider exposing the asynchronous API, think about
how to provide both access and change permissions seperately
@ -924,6 +924,13 @@ public class WifiService extends IWifiManager.Stub {
return new Messenger(mAsyncServiceHandler);
}
/** Get a reference to WifiStateMachine handler for AsyncChannel communication */
public Messenger getWifiStateMachineMessenger() {
enforceAccessPermission();
enforceChangePermission();
return mWifiStateMachine.getMessenger();
}
/**
* Get the IP and proxy configuration file
*/