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

Commit e1013f96 authored by Sanket Padawe's avatar Sanket Padawe
Browse files

API changes to add carrier name to subinforecord

API changes required to add carrier name of sim as a member of subinforecord.

Change-Id: I08a7f53dc012967005f7b5abd1fbc08f2947da67
parent f4d2c8ee
Loading
Loading
Loading
Loading
+30 −5
Original line number Diff line number Diff line
@@ -47,6 +47,11 @@ public class SubInfoRecord implements Parcelable {
     */
    private CharSequence mDisplayName;

    /**
     * The string displayed to the user that identifies Subscription Provider Name
     */
    private CharSequence mCarrierName;

    /**
     * The source of the name, NAME_SOURCE_UNDEFINED, NAME_SOURCE_DEFAULT_SOURCE,
     * NAME_SOURCE_SIM_SOURCE or NAME_SOURCE_USER_INPUT.
@@ -90,6 +95,7 @@ public class SubInfoRecord implements Parcelable {
        this.mIccId = "";
        this.mSimSlotIndex = SubscriptionManager.INVALID_SLOT_ID;
        this.mDisplayName = "";
        this.mCarrierName = "";
        this.mNameSource = 0;
        this.mColor = 0;
        this.mNumber = "";
@@ -104,12 +110,13 @@ public class SubInfoRecord implements Parcelable {
     * @hide
     */
    public SubInfoRecord(int id, String iccId, int simSlotIndex, CharSequence displayName,
            int nameSource, int color, String number, int roaming, int[] iconRes, int mcc,
            int mnc) {
            CharSequence carrierName, int nameSource, int color, String number, int roaming,
            int[] iconRes, int mcc, int mnc) {
        this.mId = id;
        this.mIccId = iccId;
        this.mSimSlotIndex = simSlotIndex;
        this.mDisplayName = displayName;
        this.mCarrierName = carrierName;
        this.mNameSource = nameSource;
        this.mColor = color;
        this.mNumber = number;
@@ -155,6 +162,22 @@ public class SubInfoRecord implements Parcelable {
        this.mDisplayName = name;
    }

    /**
     * Returns the name displayed to the user that identifies Subscription provider name
     * @hide
     */
    public CharSequence getCarrierName() {
        return this.mCarrierName;
    }

    /**
     * Sets the name displayed to the user that identifies Subscription provider name
     * @hide
     */
    public void setCarrierName(CharSequence name) {
        this.mCarrierName = name;
    }

    /**
     * Return the source of the name, eg NAME_SOURCE_UNDEFINED, NAME_SOURCE_DEFAULT_SOURCE,
     * NAME_SOURCE_SIM_SOURCE or NAME_SOURCE_USER_INPUT.
@@ -223,6 +246,7 @@ public class SubInfoRecord implements Parcelable {
            String iccId = source.readString();
            int simSlotIndex = source.readInt();
            CharSequence displayName = source.readCharSequence();
            CharSequence carrierName = source.readCharSequence();
            int nameSource = source.readInt();
            int color = source.readInt();
            String number = source.readString();
@@ -232,8 +256,8 @@ public class SubInfoRecord implements Parcelable {
            int mcc = source.readInt();
            int mnc = source.readInt();

            return new SubInfoRecord(id, iccId, simSlotIndex, displayName, nameSource, color, number,
                    dataRoaming, iconRes, mcc, mnc);
            return new SubInfoRecord(id, iccId, simSlotIndex, displayName, carrierName,
                    nameSource, color, number, dataRoaming, iconRes, mcc, mnc);
        }

        @Override
@@ -248,6 +272,7 @@ public class SubInfoRecord implements Parcelable {
        dest.writeString(mIccId);
        dest.writeInt(mSimSlotIndex);
        dest.writeCharSequence(mDisplayName);
        dest.writeCharSequence(mCarrierName);
        dest.writeInt(mNameSource);
        dest.writeInt(mColor);
        dest.writeString(mNumber);
@@ -265,7 +290,7 @@ public class SubInfoRecord implements Parcelable {
    @Override
    public String toString() {
        return "{id=" + mId + ", iccId=" + mIccId + " simSlotIndex=" + mSimSlotIndex
                + " displayName=" + mDisplayName + " nameSource=" + mNameSource + " color=" + mColor
                + " displayName=" + mDisplayName + " carrierName=" + mCarrierName + " nameSource=" + mNameSource + " color=" + mColor
                + " number=" + mNumber + " dataRoaming=" + mDataRoaming + " simIconRes=" + mSimIconRes
                + " mcc " + mMcc + " mnc " + mMnc + "}";
    }
+7 −0
Original line number Diff line number Diff line
@@ -125,6 +125,13 @@ public class SubscriptionManager implements BaseColumns {
    /** @hide */
    public static final String DISPLAY_NAME = "display_name";

    /**
     * TelephonyProvider column name for the service provider name for the SIM.
     * <P>Type: TEXT (String)</P>
     */
    /** @hide */
    public static final String CARRIER_NAME = "carrier_name";

    /**
     * Default name resource
     * @hide