How Android measures WLAN signal strength

Android-WLANindicator
Ever wondered how Android decides how many bars to show in the WLAN indicator? (Well, the “bars” are gone, but there’s still exactly the same number of levels) While going through Android source code  I’ve found this:

 >> WifiWatchdogStateMachine.java

* RSSI levels as used by notification icon
* Level 4  -55 <= RSSI
* Level 3  -66 <= RSSI < -55
* Level 2  -77 <= RSSI < -67
* Level 1  -88 <= RSSI < -78
* Level 0         RSSI < -88

>> WiFiManager.java

/** Anything worse than or equal to this will show 0 bars. */
private static final int MIN_RSSI = -100;

/** Anything better than or equal to this will show the max bars. */
private static final int MAX_RSSI = -55;

So, now you know! Of course, vendors may change these values, but let’s hope they don’t! 🙂

Why is this important? This the basis of Android’s Poor Link Detection Watchdog – the thing that causes your WLAN clients to switch to another WLAN profile or to WWAN entirely when you least expect it. But I haven’t grok’d all the code yet. Stay tuned…

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s