Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 556251df authored by Jordan Liu's avatar Jordan Liu Committed by Automerger Merge Worker
Browse files

Merge "Do not strip trailing F's of test ICCID" am: 78a8259d am: 60a553a4...

Merge "Do not strip trailing F's of test ICCID" am: 78a8259d am: 60a553a4 am: 1701e214 am: 347582a2 am: 7ee17eb8

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1852927

Change-Id: I1183bb8187eba4295cc43f9286ca5d4399d2be9d
parents 5b76efc9 7ee17eb8
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -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*$", "");
    }