diff options
author | Kensuke Ueda <uedake@nttdocomo.co.jp> | 2013-02-27 17:27:53 +0900 |
---|---|---|
committer | Amit Mahajan <amitmahajan@google.com> | 2014-10-31 15:35:23 -0700 |
commit | c962b1dcfb4bb06d87b5cdcceecc359d5e221eda (patch) | |
tree | e91f036b68c30114f52b005aa2d7a2a283c1b1c6 /telephony/java/android/telephony/SignalStrength.java | |
parent | b9eabc5c2b54145772cbec1c6cec90360925e174 (diff) | |
download | frameworks_base-c962b1dcfb4bb06d87b5cdcceecc359d5e221eda.zip frameworks_base-c962b1dcfb4bb06d87b5cdcceecc359d5e221eda.tar.gz frameworks_base-c962b1dcfb4bb06d87b5cdcceecc359d5e221eda.tar.bz2 |
Improve a calculation method for LTE antenna reception level
RSRP value thresholds is relatively high compared with
other mobile phone platforms, which make android seems
low sensitive to radio. This patch sets better thresholds.
Bug: 17891524
Change-Id: I502e1c3d08b2a52c51fe93da9b77476ac827a25b
Diffstat (limited to 'telephony/java/android/telephony/SignalStrength.java')
-rw-r--r-- | telephony/java/android/telephony/SignalStrength.java | 28 |
1 files changed, 22 insertions, 6 deletions
diff --git a/telephony/java/android/telephony/SignalStrength.java b/telephony/java/android/telephony/SignalStrength.java index 3363ca6..17db3fb 100644 --- a/telephony/java/android/telephony/SignalStrength.java +++ b/telephony/java/android/telephony/SignalStrength.java @@ -20,6 +20,7 @@ import android.os.Bundle; import android.os.Parcel; import android.os.Parcelable; import android.telephony.Rlog; +import android.content.res.Resources; /** * Contains phone signal strength related information. @@ -50,6 +51,11 @@ public class SignalStrength implements Parcelable { //Use int max, as -1 is a valid value in signal strength public static final int INVALID = 0x7FFFFFFF; + private static final int RSRP_THRESH_TYPE_STRICT = 0; + private static final int[] RSRP_THRESH_STRICT = new int[] {-140, -115, -105, -95, -85, -44}; + private static final int[] RSRP_THRESH_LENIENT = new int[] {-140, -128, -118, -108, -98, -44}; + + private int mGsmSignalStrength; // Valid values are (0-31, 99) as defined in TS 27.007 8.5 private int mGsmBitErrorRate; // bit error rate (0-7, 99) as defined in TS 27.007 8.5 private int mCdmaDbm; // This value is the RSSI value @@ -745,12 +751,21 @@ public class SignalStrength implements Parcelable { */ int rssiIconLevel = SIGNAL_STRENGTH_NONE_OR_UNKNOWN, rsrpIconLevel = -1, snrIconLevel = -1; - if (mLteRsrp > -44) rsrpIconLevel = -1; - else if (mLteRsrp >= -85) rsrpIconLevel = SIGNAL_STRENGTH_GREAT; - else if (mLteRsrp >= -95) rsrpIconLevel = SIGNAL_STRENGTH_GOOD; - else if (mLteRsrp >= -105) rsrpIconLevel = SIGNAL_STRENGTH_MODERATE; - else if (mLteRsrp >= -115) rsrpIconLevel = SIGNAL_STRENGTH_POOR; - else if (mLteRsrp >= -140) rsrpIconLevel = SIGNAL_STRENGTH_NONE_OR_UNKNOWN; + int rsrpThreshType = Resources.getSystem().getInteger(com.android.internal.R.integer. + config_LTE_RSRP_threshold_type); + int[] threshRsrp; + if (rsrpThreshType == RSRP_THRESH_TYPE_STRICT) { + threshRsrp = RSRP_THRESH_STRICT; + } else { + threshRsrp = RSRP_THRESH_LENIENT; + } + + if (mLteRsrp > threshRsrp[5]) rsrpIconLevel = -1; + else if (mLteRsrp >= threshRsrp[4]) rsrpIconLevel = SIGNAL_STRENGTH_GREAT; + else if (mLteRsrp >= threshRsrp[3]) rsrpIconLevel = SIGNAL_STRENGTH_GOOD; + else if (mLteRsrp >= threshRsrp[2]) rsrpIconLevel = SIGNAL_STRENGTH_MODERATE; + else if (mLteRsrp >= threshRsrp[1]) rsrpIconLevel = SIGNAL_STRENGTH_POOR; + else if (mLteRsrp >= threshRsrp[0]) rsrpIconLevel = SIGNAL_STRENGTH_NONE_OR_UNKNOWN; /* * Values are -200 dB to +300 (SNR*10dB) RS_SNR >= 13.0 dB =>4 bars 4.5 @@ -789,6 +804,7 @@ public class SignalStrength implements Parcelable { else if (mLteSignalStrength >= 8) rssiIconLevel = SIGNAL_STRENGTH_GOOD; else if (mLteSignalStrength >= 5) rssiIconLevel = SIGNAL_STRENGTH_MODERATE; else if (mLteSignalStrength >= 0) rssiIconLevel = SIGNAL_STRENGTH_POOR; + if (DBG) log("getLTELevel - rssi:" + mLteSignalStrength + " rssiIconLevel:" + rssiIconLevel); return rssiIconLevel; |