Merge "Adding compareIgnoreTrailingFs helper method to compare IccId's"
This commit is contained in:
committed by
Android (Google) Code Review
commit
c0168a8677
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user