summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--core/res/res/values-mcc204-mnc04/config.xml7
-rw-r--r--core/res/res/values-mcc311-mnc480/config.xml7
-rw-r--r--core/res/res/values/config.xml7
-rw-r--r--core/res/res/values/symbols.xml3
-rw-r--r--telephony/java/android/telephony/SignalStrength.java28
5 files changed, 46 insertions, 6 deletions
diff --git a/core/res/res/values-mcc204-mnc04/config.xml b/core/res/res/values-mcc204-mnc04/config.xml
index 3c03814..d7484e1 100644
--- a/core/res/res/values-mcc204-mnc04/config.xml
+++ b/core/res/res/values-mcc204-mnc04/config.xml
@@ -31,4 +31,11 @@
<item>"*611:+19085594899,BAE0000000000000"</item>
<item>"*86:+1MDN,BAE0000000000000"</item>
</string-array>
+
+ <!-- Flag indicating whether strict threshold is used, or lenient threshold is used,
+ when evaluating RSRP for LTE antenna bar display
+ 0. Strict threshold
+ 1. Lenient threshold
+ -->
+ <integer name="config_LTE_RSRP_threshold_type">0</integer>
</resources>
diff --git a/core/res/res/values-mcc311-mnc480/config.xml b/core/res/res/values-mcc311-mnc480/config.xml
index d0a57b3..8cb2928 100644
--- a/core/res/res/values-mcc311-mnc480/config.xml
+++ b/core/res/res/values-mcc311-mnc480/config.xml
@@ -49,4 +49,11 @@
<item>"*611:+19085594899,"</item>
<item>"*86:+1MDN,"</item>
</string-array>
+
+ <!-- Flag indicating whether strict threshold is used, or lenient threshold is used,
+ when evaluating RSRP for LTE antenna bar display
+ 0. Strict threshold
+ 1. Lenient threshold
+ -->
+ <integer name="config_LTE_RSRP_threshold_type">0</integer>
</resources>
diff --git a/core/res/res/values/config.xml b/core/res/res/values/config.xml
index 9332105d..60d8210 100644
--- a/core/res/res/values/config.xml
+++ b/core/res/res/values/config.xml
@@ -1885,4 +1885,11 @@
<bool name="config_switch_phone_on_voice_reg_state_change">true</bool>
<bool name="config_sms_force_7bit_encoding">false</bool>
+
+ <!-- Flag indicating whether strict threshold is used, or lenient threshold is used,
+ when evaluating RSRP for LTE antenna bar display
+ 0. Strict threshold
+ 1. Lenient threshold
+ -->
+ <integer name="config_LTE_RSRP_threshold_type">1</integer>
</resources>
diff --git a/core/res/res/values/symbols.xml b/core/res/res/values/symbols.xml
index 0432425..afe7c78 100644
--- a/core/res/res/values/symbols.xml
+++ b/core/res/res/values/symbols.xml
@@ -2094,4 +2094,7 @@
<java-symbol type="layout" name="simple_account_item" />
<java-symbol type="id" name="scrollIndicatorUp" />
<java-symbol type="id" name="scrollIndicatorDown" />
+
+ <!-- From SignalStrength -->
+ <java-symbol type="integer" name="config_LTE_RSRP_threshold_type" />
</resources>
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;