文章目录
开发平台基本信息
芯片: 展锐P7885
版本: Android 13
kernel: kernel-5.15
问题描述
最近有一款预研设备使用的是展锐 P7885 的5G 智能模组;经过天线厂调试天线后,各项指标都达到了标准,正常待机的情况下信号是 -80 到 -90之间,理论上已经是满格信号了,但是,实际上设备显示只有一格或者两格信号。
解决方法
- 解决方案就是重新按照自己的标准,定义每一格信号对应的dbm范围.
java
--- a/frameworks/base/telephony/java/android/telephony/CellSignalStrengthNr.java
+++ b/frameworks/base/telephony/java/android/telephony/CellSignalStrengthNr.java
@@ -424,7 +424,22 @@ public final class CellSignalStrengthNr extends CellSignalStrength implements Pa
}
}
// Apply the smaller value among three levels of three measures.
- mLevel = Math.min(Math.min(ssRsrpLevel, ssRsrqLevel), ssSinrLevel);
+ int rsrpLevel;
+ if (mSsRsrp > -44) {
+ rsrpLevel = SIGNAL_STRENGTH_NONE_OR_UNKNOWN;
+ } else if(mSsRsrp >= -98) {
+ rsrpLevel = SIGNAL_STRENGTH_GREAT;
+ } else if(mSsRsrp >= -108) {
+ rsrpLevel = SIGNAL_STRENGTH_GOOD;
+ } else if(mSsRsrp >= -118) {
+ rsrpLevel = SIGNAL_STRENGTH_MODERATE;
+ } else if(mSsRsrp >= -128) {
+ rsrpLevel = SIGNAL_STRENGTH_POOR;
+ } else {
+ rsrpLevel = SIGNAL_STRENGTH_NONE_OR_UNKNOWN;
+ }
+ Rlog.i(TAG, "Updated 5G mSsRsrp: " + mSsRsrp + " ;rsrpLevel:" + rsrpLevel);
+ mLevel = rsrpLevel;
}