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

Unverified Commit 4f27751d authored by Chirayu Desai's avatar Chirayu Desai Committed by Michael Bestas
Browse files

Add the user set network mode to the siminfo table

* To track what the user set for the particular sub independent
  of the currently set network mode (i.e. PREFERRED_NETWORK_MODE)
* Useful on MSIM where the modem may only support 2G on one of the slots,
  so the preferred network mode (and the NETWORK_MODE column) would
  not always reflect the user desired network mode.

Change-Id: I69d730e03a075b2684ca03a7df0086d95e0e329f
Ref: CYNGNOS-291
parent 662da8e0
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -868,7 +868,7 @@ public class NetworkControllerImpl extends BroadcastReceiver

    private SubscriptionInfo addSignalController(int id, int simSlotIndex) {
        SubscriptionInfo info = new SubscriptionInfo(id, "", simSlotIndex, "", "", 0, 0, "", 0,
                null, 0, 0, "");
                null, 0, 0, "", 0);
        mMobileSignalControllers.put(id, new MobileSignalController(mContext,
                mConfig, mHasMobileDataFeature, mPhone, mCallbackHandler, this, info,
                mSubDefaults, mReceiverHandler.getLooper()));
+19 −3
Original line number Diff line number Diff line
@@ -109,12 +109,17 @@ public class SubscriptionInfo implements Parcelable {
     */
    private String mCountryIso;

    /**
     * @hide
     */
    public int mUserNwMode;

    /**
     * @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) {
            Bitmap icon, int mcc, int mnc, String countryIso, int userNwMode) {
        this.mId = id;
        this.mIccId = iccId;
        this.mSimSlotIndex = simSlotIndex;
@@ -128,6 +133,7 @@ public class SubscriptionInfo implements Parcelable {
        this.mMcc = mcc;
        this.mMnc = mnc;
        this.mCountryIso = countryIso;
        this.mUserNwMode = userNwMode;
    }

    /**
@@ -288,6 +294,14 @@ public class SubscriptionInfo implements Parcelable {
        return this.mCountryIso;
    }

    /**
     * Returns the user set network mode.
     * @hide
     */
    public int getUserNwMode() {
        return this.mUserNwMode;
    }

    public static final Parcelable.Creator<SubscriptionInfo> CREATOR = new Parcelable.Creator<SubscriptionInfo>() {
        @Override
        public SubscriptionInfo createFromParcel(Parcel source) {
@@ -302,11 +316,12 @@ public class SubscriptionInfo implements Parcelable {
            int dataRoaming = source.readInt();
            int mcc = source.readInt();
            int mnc = source.readInt();
            int userNwMode = source.readInt();
            String countryIso = source.readString();
            Bitmap iconBitmap = Bitmap.CREATOR.createFromParcel(source);

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

        @Override
@@ -328,6 +343,7 @@ public class SubscriptionInfo implements Parcelable {
        dest.writeInt(mDataRoaming);
        dest.writeInt(mMcc);
        dest.writeInt(mMnc);
        dest.writeInt(mUserNwMode);
        dest.writeString(mCountryIso);
        mIconBitmap.writeToParcel(dest, flags);
    }
@@ -359,6 +375,6 @@ public class SubscriptionInfo implements Parcelable {
                + " displayName=" + mDisplayName + " carrierName=" + mCarrierName
                + " nameSource=" + mNameSource + " iconTint=" + mIconTint
                + " dataRoaming=" + mDataRoaming + " iconBitmap=" + mIconBitmap + " mcc " + mMcc
                + " mnc " + mMnc + "}";
                + " mnc " + mMnc + " userNwMode=" + mUserNwMode + "}";
    }
}
+7 −0
Original line number Diff line number Diff line
@@ -259,6 +259,13 @@ public class SubscriptionManager {
     */
    public static final String SIM_PROVISIONING_STATUS = "sim_provisioning_status";

    /**
     * TelephonyProvider column name for the user configured network mode associated with a SIM.
     * <P>Type: INTEGER (int)</P>
     * @hide
     */
    public static final String USER_NETWORK_MODE = "user_network_mode";

    /**
     *  TelephonyProvider column name for extreme threat in CB settings
     * @hide