Merge "Fix a crash while printing ICCID because of alphabets in UICC." into mnc-dr-dev
am: b57c65b00e
* commit 'b57c65b00efbcc6c8ed5a64b2c314dbca72d5554':
Fix a crash while printing ICCID because of alphabets in UICC.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user