Android - What does the "Aggressive Wi-Fi to Cellular handover" option in Developer Settings do?

The code for shouldSwitchNetwork() best explains what it does. It just artificially reduces the WiFi RSSI (received signal strength indication) to encourage the WiFi state machine to decide to switch the connection from WiFi to cellular network. Around line 3559 of WifiStateMachine.java (line 4262 for Android 6.0.1_r10):

int rssi = mWifiInfo.getRssi() - 6 * mAggressiveHandover
        + (homeNetworkBoost ? WifiConfiguration.HOME_NETWORK_RSSI_BOOST : 0);

The variable mAggressiveHandover is an int that is set to 0 or 1 by the Developer Settings:

private void writeWifiAggressiveHandoverOptions() {
    mWifiManager.enableAggressiveHandover(mWifiAggressiveHandover.isChecked() ? 1 : 0);
}

The rssi variable goes on to influence how the connection is classified: isBadRSSI, isLowRSSI, or isHighRSSI.

As to why it's hidden under the developer options, I'd say that is because it seems a little hackish, with a seemingly arbitrary scalar (6) that some dev came up with to nudge the behavior in the desired direction. Google is probably uncertain about the consequences of this setting and the optimal way to adjust rssi. If I'm wrong and this is somehow meaningful, I'm happy to admit it and explain here why.

Turning this setting off does NOT turn off cellular handover altogether. The WiFi connection still gets a score and is disabled if the score is too low. But hey, the initial score is set arbitrarily too.


Wifi to Cellular Handover is a feature in phones that automatically switches to cellular data when you do not have a strong WiFi connection. You would want to enable this for a few reasons:

  • It will save battery - If your phone doesn't switch to cellular data when it can't connect to a Wifi connection, your phone will continue to search for WiFi, thus using battery.
  • You won't have to turn off WiFi when you leave your house or when you don't have a connection in order to use data.