summaryrefslogtreecommitdiffstats
path: root/telephony
diff options
context:
space:
mode:
authorChirayu Desai <chirayudesai1@gmail.com>2015-07-23 01:04:17 +0530
committerDeepak Kundra <deepakkundra@gmail.com>2015-11-20 14:16:18 -0800
commit4e96928f87e288f4b2b36b47bf2e44782d4261b5 (patch)
tree16ab41c07bc22ecf8cd611da2dd5625f688c9142 /telephony
parentd64e39111d7b62b1123b84592caae8a2351eb006 (diff)
downloadframeworks_base-4e96928f87e288f4b2b36b47bf2e44782d4261b5.zip
frameworks_base-4e96928f87e288f4b2b36b47bf2e44782d4261b5.tar.gz
frameworks_base-4e96928f87e288f4b2b36b47bf2e44782d4261b5.tar.bz2
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
Diffstat (limited to 'telephony')
-rw-r--r--telephony/java/android/telephony/SubscriptionInfo.java22
-rw-r--r--telephony/java/android/telephony/SubscriptionManager.java7
2 files changed, 26 insertions, 3 deletions
diff --git a/telephony/java/android/telephony/SubscriptionInfo.java b/telephony/java/android/telephony/SubscriptionInfo.java
index 37ffa06..dbffc0b 100644
--- a/telephony/java/android/telephony/SubscriptionInfo.java
+++ b/telephony/java/android/telephony/SubscriptionInfo.java
@@ -111,9 +111,14 @@ public class SubscriptionInfo implements Parcelable {
/**
* @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;
@@ -126,6 +131,7 @@ public class SubscriptionInfo implements Parcelable {
this.mIconBitmap = icon;
this.mMcc = mcc;
this.mMnc = mnc;
+ this.mUserNwMode = userNwMode;
this.mCountryIso = countryIso;
}
@@ -277,6 +283,14 @@ public class SubscriptionInfo implements Parcelable {
}
/**
+ * Returns the User set Network mode.
+ * @hide
+ */
+ public int getUserNwMode() {
+ return this.mUserNwMode;
+ }
+
+ /**
* @return the ISO country code
*/
public String getCountryIso() {
@@ -297,11 +311,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
@@ -323,6 +338,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);
}
@@ -338,6 +354,6 @@ public class SubscriptionInfo implements Parcelable {
+ " displayName=" + mDisplayName + " carrierName=" + mCarrierName
+ " nameSource=" + mNameSource + " iconTint=" + mIconTint
+ " dataRoaming=" + mDataRoaming + " iconBitmap=" + mIconBitmap + " mcc " + mMcc
- + " mnc " + mMnc + "}";
+ + " mnc " + mMnc + " mUserNwMode=" + mUserNwMode + "}";
}
}
diff --git a/telephony/java/android/telephony/SubscriptionManager.java b/telephony/java/android/telephony/SubscriptionManager.java
index 34b9654..1578b43 100644
--- a/telephony/java/android/telephony/SubscriptionManager.java
+++ b/telephony/java/android/telephony/SubscriptionManager.java
@@ -127,6 +127,13 @@ public class SubscriptionManager {
/** @hide */
public static final String NETWORK_MODE = "network_mode";
+ /**
+ * The user configured Network mode of SIM/sub.
+ * <P>Type: INTEGER (int)</P>
+ * {@hide}
+ */
+ public static final String USER_NETWORK_MODE = "user_network_mode";
+
/** @hide */
public static final int DEFAULT_NW_MODE = -1;