Do not use operator numeric from modem for IWLAN
When the device is on IWLAN, the operator numeric
reported by modem is SIM's mcc/mnc. In this case, we
should fallback to cell identity's mcc/mnc.
Fix: 162468055
Test: Manual
Change-Id: I39efda54847b8f51e66e06d489293944f34ee223
diff --git a/src/java/com/android/internal/telephony/ServiceStateTracker.java b/src/java/com/android/internal/telephony/ServiceStateTracker.java
index c9d5714..f7852d5 100755
--- a/src/java/com/android/internal/telephony/ServiceStateTracker.java
+++ b/src/java/com/android/internal/telephony/ServiceStateTracker.java
@@ -3475,13 +3475,15 @@
tm.setNetworkOperatorNumericForPhone(mPhone.getPhoneId(), operatorNumeric);
- // If the OPERATOR command hasn't returned a valid operator, but if the device has
- // camped on a cell either to attempt registration or for emergency services, then
- // for purposes of setting the locale, we don't care if registration fails or is
+ // If the OPERATOR command hasn't returned a valid operator or the device is on IWLAN (
+ // because operatorNumeric would be SIM's mcc/mnc when device is on IWLAN), but if the
+ // device has camped on a cell either to attempt registration or for emergency services,
+ // then for purposes of setting the locale, we don't care if registration fails or is
// incomplete.
// CellIdentity can return a null MCC and MNC in CDMA
String localeOperator = operatorNumeric;
- if (isInvalidOperatorNumeric(operatorNumeric)) {
+ if (isInvalidOperatorNumeric(operatorNumeric)
+ || mSS.getDataNetworkType() == TelephonyManager.NETWORK_TYPE_IWLAN) {
for (CellIdentity cid : prioritizedCids) {
if (!TextUtils.isEmpty(cid.getPlmn())) {
localeOperator = cid.getPlmn();