aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRicardo Cerqueira <ricardo@cyngn.com>2016-04-19 20:57:53 +0100
committerRicardo Cerqueira <ricardo@cyngn.com>2016-07-14 18:46:42 +0100
commit658eea80130de80e74dee4a8a608ce419258ff5b (patch)
treed02626437a58f9b5114b5b7fa2d6063bd45b2114
parent9f4f4beef60b29a7611688bda81c78119ddedde3 (diff)
downloadandroid_frameworks_opt_telephony-658eea80130de80e74dee4a8a608ce419258ff5b.tar.gz
android_frameworks_opt_telephony-658eea80130de80e74dee4a8a608ce419258ff5b.tar.bz2
android_frameworks_opt_telephony-658eea80130de80e74dee4a8a608ce419258ff5b.zip
GsmSS: Use per-slot resources for carrier-bound options
The decision of whether an MVNO operator is roaming or not comes from an mcc/mnc-specific resource. Relying on the global system resources to provide the appropriate result for each of the slots on a multi-SIM device is just wrong, since each SIM will have (and need) its own separate preferences and arrays of compatible/blocked carriers. Ref CYNGNOS-2534, CYNGNOS-3190 Change-Id: If3b45a4a4702cf45bc1d965e26c8df7ef3ff783b
-rw-r--r--src/java/com/android/internal/telephony/gsm/GsmServiceStateTracker.java19
1 files changed, 17 insertions, 2 deletions
diff --git a/src/java/com/android/internal/telephony/gsm/GsmServiceStateTracker.java b/src/java/com/android/internal/telephony/gsm/GsmServiceStateTracker.java
index 531f393dd..995c64bb5 100644
--- a/src/java/com/android/internal/telephony/gsm/GsmServiceStateTracker.java
+++ b/src/java/com/android/internal/telephony/gsm/GsmServiceStateTracker.java
@@ -1663,8 +1663,15 @@ public class GsmServiceStateTracker extends ServiceStateTracker {
*/
private boolean isOperatorConsideredNonRoaming(ServiceState s) {
String operatorNumeric = s.getOperatorNumeric();
- String[] numericArray = mPhone.getContext().getResources().getStringArray(
+ String[] numericArray;
+ int subId = mPhone.getSubId();
+ if (subId >= 0) {
+ numericArray = SubscriptionManager.getResourcesForSubId(mPhone.getContext(),subId)
+ .getStringArray(com.android.internal.R.array.config_operatorConsideredNonRoaming);
+ } else {
+ numericArray = mPhone.getContext().getResources().getStringArray(
com.android.internal.R.array.config_operatorConsideredNonRoaming);
+ }
if (numericArray.length == 0 || operatorNumeric == null) {
return false;
@@ -1680,8 +1687,16 @@ public class GsmServiceStateTracker extends ServiceStateTracker {
private boolean isOperatorConsideredRoaming(ServiceState s) {
String operatorNumeric = s.getOperatorNumeric();
- String[] numericArray = mPhone.getContext().getResources().getStringArray(
+ String[] numericArray;
+ int subId = mPhone.getSubId();
+ if (subId >= 0) {
+ numericArray = SubscriptionManager.getResourcesForSubId(mPhone.getContext(),subId)
+ .getStringArray(
com.android.internal.R.array.config_sameNamedOperatorConsideredRoaming);
+ } else {
+ numericArray = mPhone.getContext().getResources().getStringArray(
+ com.android.internal.R.array.config_sameNamedOperatorConsideredRoaming);
+ }
if (numericArray.length == 0 || operatorNumeric == null) {
return false;