OSDN Git Service

Use Uppercase instead of Lowercase for PLMN Decode
authorNathan Harold <nharold@google.com>
Thu, 7 Jun 2018 23:00:22 +0000 (16:00 -0700)
committerNathan Harold <nharold@google.com>
Mon, 18 Jun 2018 18:50:43 +0000 (11:50 -0700)
A change to IccUtils converted from using lowercase
to uppercase and broke the PLMN trimming logic.

This resolves bugs where the platform may report
5-digit PLMNs with an invalid trailing 'F' character.

This fixes an issue introduced by aosp/575243, which
impacts the Manual Network Selection menu and
the public API.

Bug: 79561854
Test: compilation
Merged-In: I5ea7867cd9c11fe4454188fd1f30bf58b2911712
Change-Id: I5ea7867cd9c11fe4454188fd1f30bf58b2911712
(cherry picked from commit b70fbc85f7496dd1b43ed70f0c480184ba5e9585)

telephony/java/com/android/internal/telephony/uicc/IccUtils.java

index c095438..4790b75 100644 (file)
@@ -105,7 +105,7 @@ public class IccUtils {
     /**
      * PLMN (MCC/MNC) is encoded as per 24.008 10.5.1.3
      * Returns a concatenated string of MCC+MNC, stripping
-     * all invalid character 'f'
+     * all invalid character 'F'
      */
     public static String bcdPlmnToString(byte[] data, int offset) {
         if (offset + 3 > data.length) {
@@ -117,9 +117,9 @@ public class IccUtils {
         trans[2] = (byte) ((data[2 + offset] & 0xF0) | ((data[1 + offset] >> 4) & 0xF));
         String ret = bytesToHexString(trans);
 
-        // For a valid plmn we trim all character 'f'
-        if (ret.contains("f")) {
-            ret = ret.replaceAll("f", "");
+        // For a valid plmn we trim all character 'F'
+        if (ret.contains("F")) {
+            ret = ret.replaceAll("F", "");
         }
         return ret;
     }