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

Commit b7353008 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: I25d34e829e879e0b1283cd756f6e34ebacbd45d2
parent 7b74471c
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -828,7 +828,7 @@ public class SubscriptionController extends ISub.Stub {
                    if (iccId.equals(si.getIccId())) {
                        if (DBG)
                            logd("[getActiveSubInfoUsingIccId]+ iccId="
                                    + SubscriptionInfo.givePrintableIccid(iccId)
                                    + SubscriptionInfo.getPrintableId(iccId)
                                    + " subInfo=" + si);
                        return si;
                    }
@@ -836,7 +836,7 @@ public class SubscriptionController extends ISub.Stub {
            }
            if (DBG) {
                logd("[getActiveSubInfoUsingIccId]+ iccId="
                        + SubscriptionInfo.givePrintableIccid(iccId)
                        + SubscriptionInfo.getPrintableId(iccId)
                        + " subList=" + subList + " subInfo=null");
            }
        } finally {
@@ -1330,7 +1330,7 @@ public class SubscriptionController extends ISub.Stub {
        if (DBG) {
            String iccIdStr = uniqueId;
            if (!isSubscriptionForRemoteSim(subscriptionType)) {
                iccIdStr = SubscriptionInfo.givePrintableIccid(uniqueId);
                iccIdStr = SubscriptionInfo.getPrintableId(uniqueId);
            }
            logdl("[addSubInfoRecord]+ iccid: " + iccIdStr
                    + ", slotIndex: " + slotIndex
+1 −1
Original line number Diff line number Diff line
@@ -852,7 +852,7 @@ public class SubscriptionInfoUpdater extends Handler {
        // If SIM is not absent, insert new record or update existing record.
        if (!ICCID_STRING_FOR_NO_SIM.equals(sIccId[phoneId]) && sIccId[phoneId] != null) {
            logd("updateSubscriptionInfoByIccId: adding subscription info record: iccid: "
                    + SubscriptionInfo.givePrintableIccid(sIccId[phoneId])
                    + SubscriptionInfo.getPrintableId(sIccId[phoneId])
                    + ", phoneId:" + phoneId);
            mSubscriptionManager.addSubscriptionInfoRecord(sIccId[phoneId], phoneId);
        }
+3 −3
Original line number Diff line number Diff line
@@ -1067,7 +1067,7 @@ public class SubscriptionInfoInternal {
    @Override
    public String toString() {
        return "[SubscriptionInfoInternal: id=" + mId
                + " iccId=" + givePrintableId(mIccId)
                + " iccId=" + SubscriptionInfo.getPrintableId(mIccId)
                + " simSlotIndex=" + mSimSlotIndex
                + " portIndex=" + mPortIndex
                + " isEmbedded=" + mIsEmbedded
@@ -1087,7 +1087,7 @@ public class SubscriptionInfoInternal {
                + " mnc=" + mMnc
                + " ehplmns=" + mEhplmns
                + " hplmns=" + mHplmns
                + " cardString=" + givePrintableId(mCardString)
                + " cardString=" + SubscriptionInfo.getPrintableId(mCardString)
                + " cardId=" + mCardId
                + " nativeAccessRules=" + IccUtils.bytesToHexString(mNativeAccessRules)
                + " carrierConfigAccessRules=" + IccUtils.bytesToHexString(
@@ -1105,7 +1105,7 @@ public class SubscriptionInfoInternal {
                + " wifiCallingModeForRoaming="
                + ImsMmTelManager.wifiCallingModeToString(mWifiCallingModeForRoaming)
                + " enabledMobileDataPolicies=" + mEnabledMobileDataPolicies
                + " imsi=" + givePrintableId(mImsi)
                + " imsi=" + SubscriptionInfo.getPrintableId(mImsi)
                + " rcsUceEnabled=" + mIsRcsUceEnabled
                + " crossSimCallingEnabled=" + mIsCrossSimCallingEnabled
                + " rcsConfig=" + IccUtils.bytesToHexString(mRcsConfig)
+4 −4
Original line number Diff line number Diff line
@@ -1279,7 +1279,7 @@ public class SubscriptionManagerService extends ISub.Stub {
        }

        String iccId = getIccId(phoneId);
        log("updateSubscription: Found iccId=" + SubscriptionInfo.givePrintableIccid(iccId)
        log("updateSubscription: Found iccId=" + SubscriptionInfo.getPrintableId(iccId)
                + " on phone " + phoneId);

        // For eSIM switching, SIM absent will not happen. Below is to exam if we find ICCID
@@ -1935,7 +1935,7 @@ public class SubscriptionManagerService extends ISub.Stub {
    public int addSubInfo(@NonNull String iccId, @NonNull String displayName, int slotIndex,
            @SubscriptionType int subscriptionType) {
        enforcePermissions("addSubInfo", Manifest.permission.MODIFY_PHONE_STATE);
        logl("addSubInfo: iccId=" + SubscriptionInfo.givePrintableIccid(iccId) + ", slotIndex="
        logl("addSubInfo: iccId=" + SubscriptionInfo.getPrintableId(iccId) + ", slotIndex="
                + slotIndex + ", displayName=" + displayName + ", type="
                + SubscriptionManager.subscriptionTypeToString(subscriptionType) + ", "
                + getCallingPackage());
@@ -1993,7 +1993,7 @@ public class SubscriptionManagerService extends ISub.Stub {
    public int removeSubInfo(@NonNull String uniqueId, int subscriptionType) {
        enforcePermissions("removeSubInfo", Manifest.permission.MODIFY_PHONE_STATE);

        logl("removeSubInfo: uniqueId=" + SubscriptionInfo.givePrintableIccid(uniqueId) + ", "
        logl("removeSubInfo: uniqueId=" + SubscriptionInfo.getPrintableId(uniqueId) + ", "
                + SubscriptionManager.subscriptionTypeToString(subscriptionType) + ", "
                + getCallingPackage());
        final long identity = Binder.clearCallingIdentity();
@@ -3932,7 +3932,7 @@ public class SubscriptionManagerService extends ISub.Stub {
        pw.println("ICCID:");
        pw.increaseIndent();
        for (int i = 0; i < mTelephonyManager.getActiveModemCount(); i++) {
            pw.println("slot " + i + ": " + SubscriptionInfo.givePrintableIccid(getIccId(i)));
            pw.println("slot " + i + ": " + SubscriptionInfo.getPrintableId(getIccId(i)));
        }
        pw.decreaseIndent();
        pw.println();
+1 −1
Original line number Diff line number Diff line
@@ -197,7 +197,7 @@ public class IccCardStatus {
        }

        sb.append(",atr=").append(atr);
        sb.append(",iccid=").append(SubscriptionInfo.givePrintableIccid(iccid));
        sb.append(",iccid=").append(SubscriptionInfo.getPrintableId(iccid));
        sb.append(",eid=").append(Rlog.pii(TelephonyUtils.IS_DEBUGGABLE, eid));
        sb.append(",SupportedMepMode=").append(mSupportedMepMode);
        sb.append(",SlotPortMapping=").append(mSlotPortMapping);
Loading