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

Commit 407df1f5 authored by Jack Yu's avatar Jack Yu
Browse files

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
parent 0e91b7b3
Loading
Loading
Loading
Loading
+6 −4
Original line number Diff line number Diff line
@@ -3475,13 +3475,15 @@ public class ServiceStateTracker extends Handler {

            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();