diff options
author | Sanket Padawe <sanketpadawe@google.com> | 2015-11-02 15:45:18 -0800 |
---|---|---|
committer | The Android Automerger <android-build@google.com> | 2015-11-03 14:35:15 -0800 |
commit | 73546bb6d6b0854ed1774569d9537f6fa242311b (patch) | |
tree | a72dc708501b643adc71320478f69d13df24cbf3 /telephony | |
parent | 0d6d12a0ec5a7ce6bf712a5d5fadfc59b3e6f273 (diff) | |
download | frameworks_base-73546bb6d6b0854ed1774569d9537f6fa242311b.zip frameworks_base-73546bb6d6b0854ed1774569d9537f6fa242311b.tar.gz frameworks_base-73546bb6d6b0854ed1774569d9537f6fa242311b.tar.bz2 |
Fix a crash while printing ICCID because of alphabets in UICC.
Bug: 25401769
Change-Id: Ieda058817b8d3cb4b1696fd9932bd0f10da55573
Diffstat (limited to 'telephony')
-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 |