diff options
| author | 2021-10-18 23:48:16 +0000 | |
|---|---|---|
| committer | 2021-10-18 23:48:16 +0000 | |
| commit | 60a553a4e67b9b35755359883de3e8af73cbf0b5 (patch) | |
| tree | acb451444ead1b2322f777345074eec13867426f | |
| parent | 6f0afa50dcdb75e462217fc72c4c8ed4a40539af (diff) | |
| parent | 78a8259df5babd11da53e0d31f5efcf350a3c4b6 (diff) | |
Merge "Do not strip trailing F's of test ICCID" am: 78a8259df5
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1852927
Change-Id: I95ee3bacd503b1ab0cfe48b82fbe057d25aac96c
| -rw-r--r-- | telephony/java/com/android/internal/telephony/uicc/IccUtils.java | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/telephony/java/com/android/internal/telephony/uicc/IccUtils.java b/telephony/java/com/android/internal/telephony/uicc/IccUtils.java index ec1204042260..5b44dba49929 100644 --- a/telephony/java/com/android/internal/telephony/uicc/IccUtils.java +++ b/telephony/java/com/android/internal/telephony/uicc/IccUtils.java @@ -43,6 +43,10 @@ public class IccUtils { @VisibleForTesting static final int FPLMN_BYTE_SIZE = 3; + // ICCID used for tests by some OEMs + // TODO(b/159354974): Replace the constant here with UiccPortInfo.ICCID_REDACTED once ready + private static final String TEST_ICCID = "FFFFFFFFFFFFFFFFFFFF"; + // A table mapping from a number to a hex character for fast encoding hex strings. private static final char[] HEX_CHARS = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' @@ -923,6 +927,9 @@ public class IccUtils { * Strip all the trailing 'F' characters of a string, e.g., an ICCID. */ public static String stripTrailingFs(String s) { + if (TEST_ICCID.equals(s)) { + return s; + } return s == null ? null : s.replaceAll("(?i)f*$", ""); } |