OSDN Git Service

Fix mLteSignalStrength range check
authorJordan Liu <jminjie@google.com>
Fri, 9 Mar 2018 00:34:03 +0000 (16:34 -0800)
committerJordan Liu <jminjie@google.com>
Fri, 9 Mar 2018 22:35:08 +0000 (14:35 -0800)
The previous check is wrong based on the spec, and does not match the
HAL definition either.

Change-Id: Idb1c209f11a76421d477f8a1d270e23d86d621b1
Fixes: 74026897
Test: manual

telephony/java/android/telephony/SignalStrength.java

index 2074084..3feec99 100644 (file)
@@ -906,11 +906,8 @@ public class SignalStrength implements Parcelable {
 
         if (rsrpIconLevel != -1) return rsrpIconLevel;
 
-        /* Valid values are (0-63, 99) as defined in TS 36.331 */
-        // TODO the range here is probably supposed to be (0..31, 99). It's unclear if anyone relies
-        // on the current incorrect range check, so this will be fixed in a future release with more
-        // soak time
-        if (mLteSignalStrength > 63) rssiIconLevel = SIGNAL_STRENGTH_NONE_OR_UNKNOWN;
+        /* Valid values are (0-31, 99) as defined in TS 27.007 8.5 */
+        if (mLteSignalStrength > 31) rssiIconLevel = SIGNAL_STRENGTH_NONE_OR_UNKNOWN;
         else if (mLteSignalStrength >= 12) rssiIconLevel = SIGNAL_STRENGTH_GREAT;
         else if (mLteSignalStrength >= 8) rssiIconLevel = SIGNAL_STRENGTH_GOOD;
         else if (mLteSignalStrength >= 5) rssiIconLevel = SIGNAL_STRENGTH_MODERATE;