Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit db7a7357 authored by Android (Google) Code Review's avatar Android (Google) Code Review
Browse files

Merge change 3673

* changes:
  WifiStateTracker: Add support for positive RSSI values.
parents b9048924 56c59da4
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -1333,9 +1333,12 @@ public class WifiStateTracker extends NetworkStateTracker {
     */
    private synchronized void requestPolledInfo(WifiInfo info, boolean polling)
    {
        int newRssi = (polling ? WifiNative.getRssiApproxCommand():
                                 WifiNative.getRssiCommand());
        if (newRssi != -1 && -200 < newRssi && newRssi < 100) { // screen out invalid values
        int newRssi = 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.
             */
            if (newRssi > 0) newRssi -= 256;
            info.setRssi(newRssi);
            /*
             * Rather then sending the raw RSSI out every time it