diff options
-rw-r--r-- | telephony/java/android/telephony/SubscriptionInfo.java | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/telephony/java/android/telephony/SubscriptionInfo.java b/telephony/java/android/telephony/SubscriptionInfo.java index e11c8d3..d1d6e0d 100644 --- a/telephony/java/android/telephony/SubscriptionInfo.java +++ b/telephony/java/android/telephony/SubscriptionInfo.java @@ -332,9 +332,24 @@ public class SubscriptionInfo implements Parcelable { return 0; } + /** + * @hide + */ + public static String givePrintableIccid(String iccId) { + String iccIdToPrint = null; + if (iccId != null) { + if (iccId.length() > 9) { + iccIdToPrint = iccId.substring(0, 9) + "XXXXXXXXXXX"; + } else { + iccIdToPrint = iccId; + } + } + return iccIdToPrint; + } + @Override public String toString() { - String iccIdToPrint = mIccId != null ? mIccId.substring(0, 9) + "XXXXXXXXXXX" : null; + String iccIdToPrint = givePrintableIccid(mIccId); return "{id=" + mId + ", iccId=" + iccIdToPrint + " simSlotIndex=" + mSimSlotIndex + " displayName=" + mDisplayName + " carrierName=" + mCarrierName + " nameSource=" + mNameSource + " iconTint=" + mIconTint |