下面便是AOSP中WiFi RSSI 控制的地方(config_wifiRssiLevelThresholds),但是这里是在/packages/modules/Wifi/路径下面,无法修改。所以需要overlay 这个参数来进行修改。
为什么/packages/modules/Wifi/路径下无法修改,请check下面文档
https://blog.csdn.net/NiHuiShenMo/article/details/136879813?spm=1001.2014.3001.5501
<!--/packages/modules/Wifi/service/ServiceWifiResources/res/values/config.xml -->
<!--
Controls the mapping between RSSI and RSSI levels.
RSSI RSSI Level
(-infinity, thresholds[0]) 0
[threshold[0], threshold[1]) 1
[threshold[1], threshold[2]) 2
... ...
[threshold[len-2], threshold[len-1]) len-1
[threshold[len-1], +infinity) len
where:
[a, b) is the range of integers `n` such that a <= n < b
`threshold[i]` represents the i'th element of the config_wifiRssiLevelThresholds array
and `len` is the length of the config_wifiRssiLevelThresholds array.
-->
<integer-array translatable="false" name="config_wifiRssiLevelThresholds">
<!-- RSSI RSSI Level -->
<item>-88</item> <!-- (-infinity, -88) 0 -->
<item>-77</item> <!-- [-88, -77) 1 -->
<item>-66</item> <!-- [-77, -66) 2 -->
<item>-55</item> <!-- [-66, -55) 3 -->
<!-- [-55, +infinity) 4 -->
</integer-array>
Rssi分5格(-infinity, -88)(-88, -77)(-77, -66)(-66, -55)(-55, +infinity)
可以根据自己的需求进行修改,一般在-95dbm就扫描不到AP了。