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

Commit c0168a86 authored by Sandeep Jawalkar's avatar Sandeep Jawalkar Committed by Android (Google) Code Review
Browse files

Merge "Adding compareIgnoreTrailingFs helper method to compare IccId's"

parents 928116e4 9560590d
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -24,6 +24,7 @@ import android.graphics.Bitmap;
import android.graphics.Color;
import android.os.Build;
import android.telephony.UiccPortInfo;
import android.text.TextUtils;

import com.android.internal.annotations.VisibleForTesting;
import com.android.internal.telephony.GsmAlphabet;
@@ -933,6 +934,13 @@ public class IccUtils {
        return s == null ? null : s.replaceAll("(?i)f*$", "");
    }

    /**
     * Strip all the trailing 'F' characters of a string if exists and compare.
     */
    public static boolean compareIgnoreTrailingFs(String a, String b) {
        return TextUtils.equals(a, b) || TextUtils.equals(stripTrailingFs(a), stripTrailingFs(b));
    }

    /**
     * Converts a character of [0-9a-fA-F] to its hex value in a byte. If the character is not a
     * hex number, 0 will be returned.