Reintroduce wifi RssiApprox, reducing driver calls
Only do the full signal strength calc when we need to, otherwise use
an approximate value.
This change was introduced a while back but was lost in some merge.
bug: 2125543
diff --git a/wifi/java/android/net/wifi/WifiStateTracker.java b/wifi/java/android/net/wifi/WifiStateTracker.java
index 9a11404..e3d8bf4 100644
--- a/wifi/java/android/net/wifi/WifiStateTracker.java
+++ b/wifi/java/android/net/wifi/WifiStateTracker.java
@@ -1350,7 +1350,7 @@
*/
private synchronized void requestPolledInfo(WifiInfo info, boolean polling)
{
- int newRssi = WifiNative.getRssiCommand();
+ int newRssi = (polling ? WifiNative.getRssiApproxCommand() : WifiNative.getRssiCommand());
if (newRssi != -1 && -200 < newRssi && newRssi < 256) { // screen out invalid values
/* some implementations avoid negative values by adding 256
* so we need to adjust for that here.