aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/java/com/android/internal/telephony/PhoneFactory.java15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/java/com/android/internal/telephony/PhoneFactory.java b/src/java/com/android/internal/telephony/PhoneFactory.java
index 29e6ac281..7db20efaf 100644
--- a/src/java/com/android/internal/telephony/PhoneFactory.java
+++ b/src/java/com/android/internal/telephony/PhoneFactory.java
@@ -235,6 +235,13 @@ public class PhoneFactory {
// because ImsService might need it when it is being opened.
for (int i = 0; i < numPhones; i++) {
sPhones[i].startMonitoringImsService();
+ // Get users NW type, let it override if its not the default NW mode (-1)
+ int userNwType = SubscriptionController.getInstance().getUserNwMode(
+ sPhones[i].getSubId());
+ if (userNwType != SubscriptionManager.DEFAULT_NW_MODE
+ && userNwType != networkModes[i]) {
+ sPhones[i].setPreferredNetworkType(userNwType, null);
+ }
}
ITelephonyRegistry tr = ITelephonyRegistry.Stub.asInterface(
@@ -337,6 +344,14 @@ public class PhoneFactory {
int networkType = android.provider.Settings.Global.getInt(context.getContentResolver(),
android.provider.Settings.Global.PREFERRED_NETWORK_MODE + phoneSubId,
RILConstants.PREFERRED_NETWORK_MODE);
+
+ // Get users NW type, let it override if its not the default NW mode (-1)
+ int userNwType = SubscriptionController.getInstance().getUserNwMode(phoneSubId);
+ if (userNwType != SubscriptionManager.DEFAULT_NW_MODE && userNwType != networkType) {
+ Rlog.d(LOG_TAG, "calculatePreferredNetworkType: overriding for usernw mode " +
+ "phoneSubId = " + phoneSubId + " networkType = " + networkType);
+ networkType = userNwType;
+ }
Rlog.d(LOG_TAG, "calculatePreferredNetworkType: phoneSubId = " + phoneSubId +
" networkType = " + networkType);
return networkType;