android 修改无线数据信号强度
程序员文章站
2022-03-11 18:52:16
OS:MTK9.0位置:vendor/mediatek/proprietary/frameworks/opt/telephony-base/java/mediatek/telephony/SignalStrengthExt.javaOS:MTK6.0位置:vendor/mediatek/proprietary/frameworks/base/packages/FwkPlugin/src/com/mediatek/op/telephony/DefaultServiceStateExt.java...
OS:MTK9.0
- 位置:vendor/mediatek/proprietary/frameworks/opt/telephony-base/java/mediatek/telephony/SignalStrengthExt.java
OS:MTK6.0
- 位置:vendor/mediatek/proprietary/frameworks/base/packages/FwkPlugin/src/com/mediatek/op/telephony/DefaultServiceStateExt.java
// 6.0
public int mapGsmSignalLevel(int asu, int gsmRscpQdbm) {
int level;
// [ALPS01055164] -- START , for 3G network
if (gsmRscpQdbm < 0) {
// 3G network
if (asu <= 5 || asu == 99) {
level = SignalStrength.SIGNAL_STRENGTH_NONE_OR_UNKNOWN;
} else if (asu >= 14) {
level = SignalStrength.SIGNAL_STRENGTH_GREAT;
} else if (asu >= 11) {
level = SignalStrength.SIGNAL_STRENGTH_GOOD;
} else if (asu >= 8) {
level = SignalStrength.SIGNAL_STRENGTH_MODERATE;
} else {
level = SignalStrength.SIGNAL_STRENGTH_POOR;
}
// [ALPS01055164] -- END
} else {
// 2G network
if (asu <= 2 || asu == 99) {
level = SignalStrength.SIGNAL_STRENGTH_NONE_OR_UNKNOWN;
} else if (asu >= 12) {
level = SignalStrength.SIGNAL_STRENGTH_GREAT;
} else if (asu >= 8) {
level = SignalStrength.SIGNAL_STRENGTH_GOOD;
} else if (asu >= 5) {
level = SignalStrength.SIGNAL_STRENGTH_MODERATE;
} else {
level = SignalStrength.SIGNAL_STRENGTH_POOR;
}
}
return level;
}
public int mapLteSignalLevel(int mLteRsrp, int mLteRssnr, int mLteSignalStrength) {
/*
* TS 36.214 Physical Layer Section 5.1.3 TS 36.331 RRC RSSI = received
* signal + noise RSRP = reference signal dBm RSRQ = quality of signal
* dB= Number of Resource blocksxRSRP/RSSI SNR = gain=signal/noise ratio
* = -10log P1/P2 dB
*/
int rssiIconLevel = SignalStrength.SIGNAL_STRENGTH_NONE_OR_UNKNOWN;
int rsrpIconLevel = -1;
int snrIconLevel = -1;
if (mLteRsrp > -44) {
rsrpIconLevel = -1;
} else if (mLteRsrp >= -97) {
rsrpIconLevel = SignalStrength.SIGNAL_STRENGTH_GREAT;
} else if (mLteRsrp >= -107) {
rsrpIconLevel = SignalStrength.SIGNAL_STRENGTH_GOOD;
} else if (mLteRsrp >= -117) {
rsrpIconLevel = SignalStrength.SIGNAL_STRENGTH_MODERATE;
} else if (mLteRsrp >= -125) {
rsrpIconLevel = SignalStrength.SIGNAL_STRENGTH_POOR;
} else if (mLteRsrp >= -140) {
rsrpIconLevel = SignalStrength.SIGNAL_STRENGTH_NONE_OR_UNKNOWN;
}
/*
* Values are -200 dB to +300 (SNR*10dB) RS_SNR >= 13.0 dB =>4 bars 4.5
* dB <= RS_SNR < 13.0 dB => 3 bars 1.0 dB <= RS_SNR < 4.5 dB => 2 bars
* -3.0 dB <= RS_SNR < 1.0 dB 1 bar RS_SNR < -3.0 dB/No Service Antenna
* Icon Only
*/
if (mLteRssnr > 300) {
snrIconLevel = -1;
} else if (mLteRssnr >= 118) {
snrIconLevel = SignalStrength.SIGNAL_STRENGTH_GREAT;
} else if (mLteRssnr >= 33) {
snrIconLevel = SignalStrength.SIGNAL_STRENGTH_GOOD;
} else if (mLteRssnr >= 0) {
snrIconLevel = SignalStrength.SIGNAL_STRENGTH_MODERATE;
} else if (mLteRssnr >= -40) {
snrIconLevel = SignalStrength.SIGNAL_STRENGTH_POOR;
} else if (mLteRssnr >= -200) {
snrIconLevel = SignalStrength.SIGNAL_STRENGTH_NONE_OR_UNKNOWN;
}
Log.i(TAG, "getLTELevel - rsrp:" + mLteRsrp + " snr:" + mLteRssnr + " rsrpIconLevel:"
+ rsrpIconLevel + " snrIconLevel:" + snrIconLevel);
...
}
本文地址:https://blog.csdn.net/wxd_csdn_2016/article/details/107980132
上一篇: 女同事跳舞
推荐阅读
-
android wifi信号强度等级区分的修改介绍
-
android wifi信号强度等级区分的修改介绍
-
Android 调用系统裁剪不返回数据的情况下用文件修改时间判断用户到底裁没裁剪
-
Android 11有望完善无线ADB调试功能:扔掉数据线吧
-
Android列表组件ListView使用详解之动态加载或修改列表数据
-
自己整理的android studio 自定义弹框获取和修改listview的数据
-
android 修改无线数据信号强度
-
自己整理的android studio 自定义弹框获取和修改listview的数据
-
关于Android中内容操作数据库失败的原因及修改方法
-
mysql-Android通过PHP连接MySQL修改数据