summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
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
commitc962b1dcfb4bb06d87b5cdcceecc359d5e221eda (patch)
treee91f036b68c30114f52b005aa2d7a2a283c1b1c6
parentb9eabc5c2b54145772cbec1c6cec90360925e174 (diff)
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
-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 3c0381427b8a..d7484e164576 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 d0a57b37ee10..8cb2928e83e2 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 9332105d76d7..60d8210b4886 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 0432425d503e..afe7c78428b7 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 3363ca678c6a..17db3fb97d7b 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;