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

Commit 921daf9e authored by yinxu's avatar yinxu
Browse files

Add CARD_ID in SubscriptionInfo database

Test: Basic telephony sanity
Bug: 64131518

Change-Id: I1c3c903ad2fc15fd49f4ece9ada4cbfa792a28ce
parent 05284b6c
Loading
Loading
Loading
Loading
+36 −6
Original line number Original line Diff line number Diff line
@@ -125,6 +125,12 @@ public class SubscriptionInfo implements Parcelable {
    @Nullable
    @Nullable
    private UiccAccessRule[] mAccessRules;
    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
     * @hide
     */
     */
@@ -133,7 +139,7 @@ public class SubscriptionInfo implements Parcelable {
        Bitmap icon, int mcc, int mnc, String countryIso) {
        Bitmap icon, int mcc, int mnc, String countryIso) {
        this(id, iccId, simSlotIndex, displayName, carrierName, nameSource, iconTint, number,
        this(id, iccId, simSlotIndex, displayName, carrierName, nameSource, iconTint, number,
            roaming, icon, mcc, mnc, countryIso, false /* isEmbedded */,
            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,
            CharSequence carrierName, int nameSource, int iconTint, String number, int roaming,
            Bitmap icon, int mcc, int mnc, String countryIso,  boolean isEmbedded,
            Bitmap icon, int mcc, int mnc, String countryIso,  boolean isEmbedded,
            @Nullable UiccAccessRule[] accessRules) {
            @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.mId = id;
        this.mIccId = iccId;
        this.mIccId = iccId;
        this.mSimSlotIndex = simSlotIndex;
        this.mSimSlotIndex = simSlotIndex;
@@ -158,6 +175,7 @@ public class SubscriptionInfo implements Parcelable {
        this.mCountryIso = countryIso;
        this.mCountryIso = countryIso;
        this.mIsEmbedded = isEmbedded;
        this.mIsEmbedded = isEmbedded;
        this.mAccessRules = accessRules;
        this.mAccessRules = accessRules;
        this.mCardId = cardId;
    }
    }


    /**
    /**
@@ -387,6 +405,14 @@ public class SubscriptionInfo implements Parcelable {
        return mAccessRules;
        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>() {
    public static final Parcelable.Creator<SubscriptionInfo> CREATOR = new Parcelable.Creator<SubscriptionInfo>() {
        @Override
        @Override
        public SubscriptionInfo createFromParcel(Parcel source) {
        public SubscriptionInfo createFromParcel(Parcel source) {
@@ -405,10 +431,11 @@ public class SubscriptionInfo implements Parcelable {
            Bitmap iconBitmap = Bitmap.CREATOR.createFromParcel(source);
            Bitmap iconBitmap = Bitmap.CREATOR.createFromParcel(source);
            boolean isEmbedded = source.readBoolean();
            boolean isEmbedded = source.readBoolean();
            UiccAccessRule[] accessRules = source.createTypedArray(UiccAccessRule.CREATOR);
            UiccAccessRule[] accessRules = source.createTypedArray(UiccAccessRule.CREATOR);
            String cardId = source.readString();


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


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


    @Override
    @Override
@@ -459,11 +487,13 @@ public class SubscriptionInfo implements Parcelable {
    @Override
    @Override
    public String toString() {
    public String toString() {
        String iccIdToPrint = givePrintableIccid(mIccId);
        String iccIdToPrint = givePrintableIccid(mIccId);
        String cardIdToPrint = givePrintableIccid(mCardId);
        return "{id=" + mId + ", iccId=" + iccIdToPrint + " simSlotIndex=" + mSimSlotIndex
        return "{id=" + mId + ", iccId=" + iccIdToPrint + " simSlotIndex=" + mSimSlotIndex
                + " displayName=" + mDisplayName + " carrierName=" + mCarrierName
                + " displayName=" + mDisplayName + " carrierName=" + mCarrierName
                + " nameSource=" + mNameSource + " iconTint=" + mIconTint
                + " nameSource=" + mNameSource + " iconTint=" + mIconTint
                + " dataRoaming=" + mDataRoaming + " iconBitmap=" + mIconBitmap + " mcc " + mMcc
                + " dataRoaming=" + mDataRoaming + " iconBitmap=" + mIconBitmap + " mcc " + mMcc
                + " mnc " + mMnc + " isEmbedded " + mIsEmbedded
                + " mnc " + mMnc + " isEmbedded " + mIsEmbedded
                + " accessRules " + Arrays.toString(mAccessRules) + "}";
                + " accessRules " + Arrays.toString(mAccessRules)
                + " cardId=" + cardIdToPrint + "}";
    }
    }
}
}
+8 −0
Original line number Original line Diff line number Diff line
@@ -270,6 +270,14 @@ public class SubscriptionManager {
     */
     */
    public static final String IS_EMBEDDED = "is_embedded";
    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
     * TelephonyProvider column name for the encoded {@link UiccAccessRule}s from
     * {@link UiccAccessRule#encodeRules}. Only present if {@link #IS_EMBEDDED} is 1.
     * {@link UiccAccessRule#encodeRules}. Only present if {@link #IS_EMBEDDED} is 1.