Android N 在任何訊號環境下,dbm上的3G訊號強度都不同於網路訊號AP
阿新 • • 發佈:2019-01-08
在切換到 3G 的網路時,使用 Network Info Widge app測試 3G 的訊號強度與設定中顯示的訊號強度不一致,而切換到 2G 或 4G 網路時,訊號強度顯示是一致。經分析導致 3G 網路顯示訊號強度不一致的原因是第三方 app 和設定中獲取訊號強度的計算公式不一樣導致。
設定 中的3G 網路計算訊號強度公式為:dBm = gsmRscpQdbm / 4,而第三方獲取 3G 網路計算訊號強度公式為:dBm = -113 + (2 * asu)。因此解決此問題的方法只需把設定 3G 網路計算訊號強度公式修改為 dBm = -113 + (2 * asu)即可,此方法的修改不會影響到訊號格顯示的問題。
具體修改方法如下:
- alps/vendor/mediatek/proprietary/frameworks/base/packages/FwkPlugin/src/com/mediatek/op/telephony/DefaultServiceStateExt.java
--- a/alps/vendor/mediatek/proprietary/frameworks/base/packages/FwkPlugin/src/com/mediatek/op/telephony/DefaultServiceStateExt.java +++ b/alps/vendor/mediatek/proprietary/frameworks/base/packages/FwkPlugin/src/com/mediatek/op/telephony/DefaultServiceStateExt.java @@ -304,7 +304,10 @@ public class DefaultServiceStateExt implements IServiceStateExt { int dBm; Log.d(TAG, "mapGsmSignalDbm() gsmRscpQdbm=" + gsmRscpQdbm + " asu=" + asu); if (gsmRscpQdbm < 0) { - dBm = gsmRscpQdbm / 4; //Return raw value for 3G Network + //dBm = gsmRscpQdbm / 4; //Return raw value for 3G Network + dBm = -113 + (2 * asu); } else { dBm = -113 + (2 * asu); }
- alps/vendor/mediatek/proprietary/operator/OP01/frameworks/packages/FwkPlugin/src/com/mediatek/op/telephony/ServiceStateExtOP01.java
--- a/alps/vendor/mediatek/proprietary/operator/OP01/frameworks/packages/FwkPlugin/src/com/mediatek/op/telephony/ServiceStateExtOP01.java +++ b/alps/vendor/mediatek/proprietary/operator/OP01/frameworks/packages/FwkPlugin/src/com/mediatek/op/telephony/ServiceStateExtOP01.java @@ -129,7 +129,10 @@ public class ServiceStateExtOP01 extends DefaultServiceStateExt { int dBm; if (gsmRscpQdbm < 0) { - dBm = gsmRscpQdbm / 4; // Return raw value for TDD 3G network. + //dBm = gsmRscpQdbm / 4; // Return raw value for TDD 3G network. + dBm = -113 + (2 * asu); } else { dBm = -113 + (2 * asu); }