WiFi信号图标等级计算
程序员文章站
2022-03-25 08:21:12
android中wifi分为5个等级,对应的图标是0格,1格,2格,3格,4格.其是如何计算的呢?/frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/policy/AccessPointControllerImpl.javapublic int getIcon(AccessPoint ap) { int level = ap.getLevel(); return ICONS[level >=...
android中wifi分为5个等级,对应的图标是0格,1格,2格,3格,4格.
其是如何计算的呢?
/frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/policy/AccessPointControllerImpl.java
public int getIcon(AccessPoint ap) {
int level = ap.getLevel();
return ICONS[level >= 0 ? level : 0];
}
/frameworks/base/packages/SettingsLib/src/com/android/settingslib/wifi/AccessPoint.java
public int getLevel() {
return WifiManager.calculateSignalLevel(mRssi, SIGNAL_LEVELS);
}
具体实现:
所有rssi对应的信号格数应该为:
0 rssi<=-100
1 (-100, -88]
2 (-88, -77]
3 (-66, -55]
4 rssi>=-55
本文地址:https://blog.csdn.net/weixin_44343246/article/details/108978188