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

Commit 6745e15d authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "Add CARD_ID in SubscriptionInfo database"

parents 8fb3bdc3 921daf9e
Loading
Loading
Loading
Loading
+36 −6
Original line number Diff line number Diff line
@@ -125,6 +125,12 @@ public class SubscriptionInfo implements Parcelable {
    @Nullable
    private UiccAccessRule[] mAccessRules;

    /**
     * The ID of the SIM card. It is the ICCID of the active profile for a UICC card and the EID
     * for an eUICC card.
     */
    private String mCardId;

    /**
     * @hide
     */
@@ -133,7 +139,7 @@ public class SubscriptionInfo implements Parcelable {
        Bitmap icon, int mcc, int mnc, String countryIso) {
        this(id, iccId, simSlotIndex, displayName, carrierName, nameSource, iconTint, number,
            roaming, icon, mcc, mnc, countryIso, false /* isEmbedded */,
                null /* accessRules */);
            null /* accessRules */, null /* accessRules */);
    }

    /**
@@ -143,6 +149,17 @@ public class SubscriptionInfo implements Parcelable {
            CharSequence carrierName, int nameSource, int iconTint, String number, int roaming,
            Bitmap icon, int mcc, int mnc, String countryIso,  boolean isEmbedded,
            @Nullable UiccAccessRule[] accessRules) {
        this(id, iccId, simSlotIndex, displayName, carrierName, nameSource, iconTint, number,
                roaming, icon, mcc, mnc, countryIso, isEmbedded, accessRules, null /* cardId */);
    }

    /**
     * @hide
     */
    public SubscriptionInfo(int id, String iccId, int simSlotIndex, CharSequence displayName,
            CharSequence carrierName, int nameSource, int iconTint, String number, int roaming,
            Bitmap icon, int mcc, int mnc, String countryIso, boolean isEmbedded,
            @Nullable UiccAccessRule[] accessRules, String cardId) {
        this.mId = id;
        this.mIccId = iccId;
        this.mSimSlotIndex = simSlotIndex;
@@ -158,6 +175,7 @@ public class SubscriptionInfo implements Parcelable {
        this.mCountryIso = countryIso;
        this.mIsEmbedded = isEmbedded;
        this.mAccessRules = accessRules;
        this.mCardId = cardId;
    }

    /**
@@ -387,6 +405,14 @@ public class SubscriptionInfo implements Parcelable {
        return mAccessRules;
    }

    /**
     * @return the ID of the SIM card which contains the subscription.
     * @hide
     */
    public String getCardId() {
        return this.mCardId;
    }

    public static final Parcelable.Creator<SubscriptionInfo> CREATOR = new Parcelable.Creator<SubscriptionInfo>() {
        @Override
        public SubscriptionInfo createFromParcel(Parcel source) {
@@ -405,10 +431,11 @@ public class SubscriptionInfo implements Parcelable {
            Bitmap iconBitmap = Bitmap.CREATOR.createFromParcel(source);
            boolean isEmbedded = source.readBoolean();
            UiccAccessRule[] accessRules = source.createTypedArray(UiccAccessRule.CREATOR);
            String cardId = source.readString();

            return new SubscriptionInfo(id, iccId, simSlotIndex, displayName, carrierName,
                    nameSource, iconTint, number, dataRoaming, iconBitmap, mcc, mnc, countryIso,
                    isEmbedded, accessRules);
                    isEmbedded, accessRules, cardId);
        }

        @Override
@@ -434,6 +461,7 @@ public class SubscriptionInfo implements Parcelable {
        mIconBitmap.writeToParcel(dest, flags);
        dest.writeBoolean(mIsEmbedded);
        dest.writeTypedArray(mAccessRules, flags);
        dest.writeString(mCardId);
    }

    @Override
@@ -459,11 +487,13 @@ public class SubscriptionInfo implements Parcelable {
    @Override
    public String toString() {
        String iccIdToPrint = givePrintableIccid(mIccId);
        String cardIdToPrint = givePrintableIccid(mCardId);
        return "{id=" + mId + ", iccId=" + iccIdToPrint + " simSlotIndex=" + mSimSlotIndex
                + " displayName=" + mDisplayName + " carrierName=" + mCarrierName
                + " nameSource=" + mNameSource + " iconTint=" + mIconTint
                + " dataRoaming=" + mDataRoaming + " iconBitmap=" + mIconBitmap + " mcc " + mMcc
                + " mnc " + mMnc + " isEmbedded " + mIsEmbedded
                + " accessRules " + Arrays.toString(mAccessRules) + "}";
                + " accessRules " + Arrays.toString(mAccessRules)
                + " cardId=" + cardIdToPrint + "}";
    }
}
+8 −0
Original line number Diff line number Diff line
@@ -270,6 +270,14 @@ public class SubscriptionManager {
     */
    public static final String IS_EMBEDDED = "is_embedded";

    /**
     * TelephonyProvider column name for SIM card identifier. For UICC card it is the ICCID of the
     * current enabled profile on the card, while for eUICC card it is the EID of the card.
     * <P>Type: TEXT (String)</P>
     * @hide
     */
     public static final String CARD_ID = "card_id";

    /**
     * TelephonyProvider column name for the encoded {@link UiccAccessRule}s from
     * {@link UiccAccessRule#encodeRules}. Only present if {@link #IS_EMBEDDED} is 1.