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

Commit 6408959c authored by Rakesh Pallerla's avatar Rakesh Pallerla Committed by Linux Build Service Account
Browse files

Store Network Mode selected in subId Table.

Modify code to store network selected by user in
subId table.

Change-Id: I3175de81ddde64e496192909ef9e5dd079646bc9
parent 3e511afa
Loading
Loading
Loading
Loading
+10 −5
Original line number Diff line number Diff line
@@ -76,6 +76,7 @@ public class SubInfoRecord implements Parcelable {
     */
    public int mnc;
    public int mStatus;
    public int mNwMode;

    public SubInfoRecord() {
        this.subId = SubscriptionManager.INVALID_SUB_ID;
@@ -90,12 +91,13 @@ public class SubInfoRecord implements Parcelable {
        this.simIconRes = new int[2];
        this.mcc = 0;
        this.mnc = 0;
        this.mStatus = SubscriptionManager.INACTIVE;
        this.mStatus = SubscriptionManager.ACTIVE;
        this.mNwMode = SubscriptionManager.DEFAULT_NW_MODE;
    }

    public SubInfoRecord(long subId, String iccId, int slotId, String displayName, int nameSource,
            int color, String number, int displayFormat, int roaming, int[] iconRes,
            int mcc, int mnc, int status) {
            int mcc, int mnc, int status, int nwMode) {
        this.subId = subId;
        this.iccId = iccId;
        this.slotId = slotId;
@@ -109,6 +111,7 @@ public class SubInfoRecord implements Parcelable {
        this.mcc = mcc;
        this.mnc = mnc;
        this.mStatus = status;
        this.mNwMode = nwMode;
    }

    public static final Parcelable.Creator<SubInfoRecord> CREATOR = new Parcelable.Creator<SubInfoRecord>() {
@@ -128,9 +131,10 @@ public class SubInfoRecord implements Parcelable {
            int mcc = source.readInt();
            int mnc = source.readInt();
           int status = source.readInt();
           int nwMode = source.readInt();

            return new SubInfoRecord(subId, iccId, slotId, displayName, nameSource, color, number,
                displayNumberFormat, dataRoaming, iconRes, mcc, mnc, status);
                displayNumberFormat, dataRoaming, iconRes, mcc, mnc, status, nwMode);
        }

        @Override
@@ -154,6 +158,7 @@ public class SubInfoRecord implements Parcelable {
        dest.writeInt(mcc);
        dest.writeInt(mnc);
        dest.writeInt(mStatus);
        dest.writeInt(mNwMode);
    }

    @Override
@@ -168,6 +173,6 @@ public class SubInfoRecord implements Parcelable {
                + " mColor=" + color + " mNumber=" + number
                + " mDisplayNumberFormat=" + displayNumberFormat + " mDataRoaming=" + dataRoaming
                + " mSimIconRes=" + simIconRes + " mMcc " + mcc + " mMnc " + mnc
                + " mStatus=" + mStatus + "}";
                + " mSubStatus=" + mStatus + " mNwMode=" + mNwMode + "}";
    }
}
+9 −0
Original line number Diff line number Diff line
@@ -27,6 +27,7 @@ import android.os.RemoteException;

import com.android.internal.telephony.ISub;
import com.android.internal.telephony.PhoneConstants;
import com.android.internal.telephony.RILConstants;

import java.util.ArrayList;
import java.util.List;
@@ -117,6 +118,14 @@ public class SubscriptionManager implements BaseColumns {
    /** @hide - to be unhidden */
    public static final int SIM_NOT_INSERTED = -1;

    /**
     * The Network mode of SIM/sub.
     * <P>Type: INTEGER (int)</P>
     */
    public static final String NETWORK_MODE = "network_mode";

    public static final int DEFAULT_NW_MODE = -1;

    /**
     * The activation state of SIM/sub.
     * <P>Type: INTEGER (int)</P>