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

Commit fb5ef375 authored by Jack Yu's avatar Jack Yu
Browse files

Renamed the id printing method

Renamed the id printing method, which is not only for
iccid.

Also improved the test coverage.

Bug: 272989110
Test: atest SubscriptionDatabaseManagerTest
Test: Basic phone functionality
Change-Id: I7462c54052d5c7dd8926aff08abcc40a4e54fa90
parent 35b0657c
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -453,7 +453,7 @@ public final class EuiccProfileInfo implements Parcelable {
                + ", accessRules="
                + Arrays.toString(mAccessRules)
                + ", iccid="
                + SubscriptionInfo.givePrintableIccid(mIccid)
                + SubscriptionInfo.getPrintableId(mIccid)
                + ")";
    }
}
+12 −11
Original line number Diff line number Diff line
@@ -947,29 +947,30 @@ public class SubscriptionInfo implements Parcelable {
    }

    /**
     * Get ICCID stripped PII information on user build.
     * Get stripped PII information from the id.
     *
     * @param iccId The original ICCID.
     * @param id The raw id (e.g. ICCID, IMSI, etc...).
     * @return The stripped string.
     *
     * @hide
     */
    public static String givePrintableIccid(String iccId) {
        String iccIdToPrint = null;
        if (iccId != null) {
            if (iccId.length() > 9 && !TelephonyUtils.IS_DEBUGGABLE) {
                iccIdToPrint = iccId.substring(0, 9) + Rlog.pii(false, iccId.substring(9));
    @Nullable
    public static String getPrintableId(@Nullable String id) {
        String idToPrint = null;
        if (id != null) {
            if (id.length() > 9 && !TelephonyUtils.IS_DEBUGGABLE) {
                idToPrint = id.substring(0, 9) + Rlog.pii(false, id.substring(9));
            } else {
                iccIdToPrint = iccId;
                idToPrint = id;
            }
        }
        return iccIdToPrint;
        return idToPrint;
    }

    @Override
    public String toString() {
        String iccIdToPrint = givePrintableIccid(mIccId);
        String cardStringToPrint = givePrintableIccid(mCardString);
        String iccIdToPrint = getPrintableId(mIccId);
        String cardStringToPrint = getPrintableId(mCardString);
        return "[SubscriptionInfo: id=" + mId
                + " iccId=" + iccIdToPrint
                + " simSlotIndex=" + mSimSlotIndex
+1 −1
Original line number Diff line number Diff line
@@ -165,7 +165,7 @@ public final class UiccPortInfo implements Parcelable{
        return "UiccPortInfo (isActive="
                + mIsActive
                + ", iccId="
                + SubscriptionInfo.givePrintableIccid(mIccId)
                + SubscriptionInfo.getPrintableId(mIccId)
                + ", portIndex="
                + mPortIndex
                + ", mLogicalSlotIndex="
+1 −1
Original line number Diff line number Diff line
@@ -281,7 +281,7 @@ public class UiccSlotInfo implements Parcelable {
                + ", mIsEuicc="
                + mIsEuicc
                + ", mCardId="
                + SubscriptionInfo.givePrintableIccid(mCardId)
                + SubscriptionInfo.getPrintableId(mCardId)
                + ", cardState="
                + mCardStateInfo
                + ", mIsExtendedApduSupported="