Loading flags/network.aconfig +11 −0 Original line number Diff line number Diff line Loading @@ -110,3 +110,14 @@ flag { description: "guard system API onCellularIdentifierDisclosedChanged" bug: "355062720" } # OWNER=jackyu TARGET=25Q3 flag { name: "ignore_mcc_mnc_from_operator_for_locale" namespace: "telephony" description: "Ignoring mcc/mnc from RIL indication OPERATOR but only relying MCC/MNC from registered or nearby cells." bug:"374589521" metadata { purpose: PURPOSE_BUGFIX } } src/java/com/android/internal/telephony/ServiceStateTracker.java +24 −17 Original line number Diff line number Diff line Loading @@ -360,6 +360,9 @@ public class ServiceStateTracker extends Handler { private Pattern mOperatorNameStringPattern; private PersistableBundle mCarrierConfig; @NonNull private final FeatureFlags mFeatureFlags; private class SstSubscriptionsChangedListener extends OnSubscriptionsChangedListener { /** Loading Loading @@ -705,6 +708,7 @@ public class ServiceStateTracker extends Handler { .makeNitzStateMachine(phone); mPhone = phone; mCi = ci; mFeatureFlags = featureFlags; mServiceStateStats = new ServiceStateStats(mPhone); Loading Loading @@ -3867,24 +3871,27 @@ public class ServiceStateTracker extends Handler { tm.setNetworkOperatorNumericForPhone(mPhone.getPhoneId(), operatorNumeric); // 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. Additionally, if there is no cellular service and ims is registered over // the IWLAN, the locale will not be updated. String localeOperator = null; if (!mFeatureFlags.ignoreMccMncFromOperatorForLocale()) { // 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. Additionally, if there is no cellular // service and ims is registered over the IWLAN, the locale will not be updated. // CellIdentity can return a null MCC and MNC in CDMA String localeOperator = operatorNumeric; localeOperator = operatorNumeric; int dataNetworkType = mSS.getDataNetworkType(); if (dataNetworkType == TelephonyManager.NETWORK_TYPE_IWLAN || (dataNetworkType == TelephonyManager.NETWORK_TYPE_UNKNOWN && getImsRegistrationTech() == ImsRegistrationImplBase.REGISTRATION_TECH_IWLAN)) { // TODO(b/333346537#comment10): Complete solution would be ignore mcc/mnc reported // by the unsolicited indication OPERATOR from RIL, but only relies on MCC/MNC from // data registration or voice registration. // TODO(b/333346537#comment10): Complete solution would be ignore mcc/mnc // reported by the unsolicited indication OPERATOR from RIL, but only relies on // MCC/MNC from data registration or voice registration. localeOperator = null; } } if (isInvalidOperatorNumeric(localeOperator)) { for (CellIdentity cid : prioritizedCids) { if (!TextUtils.isEmpty(cid.getPlmn())) { Loading Loading
flags/network.aconfig +11 −0 Original line number Diff line number Diff line Loading @@ -110,3 +110,14 @@ flag { description: "guard system API onCellularIdentifierDisclosedChanged" bug: "355062720" } # OWNER=jackyu TARGET=25Q3 flag { name: "ignore_mcc_mnc_from_operator_for_locale" namespace: "telephony" description: "Ignoring mcc/mnc from RIL indication OPERATOR but only relying MCC/MNC from registered or nearby cells." bug:"374589521" metadata { purpose: PURPOSE_BUGFIX } }
src/java/com/android/internal/telephony/ServiceStateTracker.java +24 −17 Original line number Diff line number Diff line Loading @@ -360,6 +360,9 @@ public class ServiceStateTracker extends Handler { private Pattern mOperatorNameStringPattern; private PersistableBundle mCarrierConfig; @NonNull private final FeatureFlags mFeatureFlags; private class SstSubscriptionsChangedListener extends OnSubscriptionsChangedListener { /** Loading Loading @@ -705,6 +708,7 @@ public class ServiceStateTracker extends Handler { .makeNitzStateMachine(phone); mPhone = phone; mCi = ci; mFeatureFlags = featureFlags; mServiceStateStats = new ServiceStateStats(mPhone); Loading Loading @@ -3867,24 +3871,27 @@ public class ServiceStateTracker extends Handler { tm.setNetworkOperatorNumericForPhone(mPhone.getPhoneId(), operatorNumeric); // 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. Additionally, if there is no cellular service and ims is registered over // the IWLAN, the locale will not be updated. String localeOperator = null; if (!mFeatureFlags.ignoreMccMncFromOperatorForLocale()) { // 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. Additionally, if there is no cellular // service and ims is registered over the IWLAN, the locale will not be updated. // CellIdentity can return a null MCC and MNC in CDMA String localeOperator = operatorNumeric; localeOperator = operatorNumeric; int dataNetworkType = mSS.getDataNetworkType(); if (dataNetworkType == TelephonyManager.NETWORK_TYPE_IWLAN || (dataNetworkType == TelephonyManager.NETWORK_TYPE_UNKNOWN && getImsRegistrationTech() == ImsRegistrationImplBase.REGISTRATION_TECH_IWLAN)) { // TODO(b/333346537#comment10): Complete solution would be ignore mcc/mnc reported // by the unsolicited indication OPERATOR from RIL, but only relies on MCC/MNC from // data registration or voice registration. // TODO(b/333346537#comment10): Complete solution would be ignore mcc/mnc // reported by the unsolicited indication OPERATOR from RIL, but only relies on // MCC/MNC from data registration or voice registration. localeOperator = null; } } if (isInvalidOperatorNumeric(localeOperator)) { for (CellIdentity cid : prioritizedCids) { if (!TextUtils.isEmpty(cid.getPlmn())) { Loading