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

Commit eb294deb authored by Jack Yu's avatar Jack Yu
Browse files

Removed the flag ignore_mcc_mnc_from_operator_for_locale

Removed the 25Q3 flag ignore_mcc_mnc_from_operator_for_locale

Fix: 409611065
Test: atest FrameworksTelephonyTests
Test: Basic telephony functionality tests
Flag: EXEMPT flag removal
Change-Id: I8bce40eae3ca38e0c7e1876b3d1f5fd28708120a
parent 5ee782b1
Loading
Loading
Loading
Loading
+0 −11
Original line number Diff line number Diff line
@@ -37,17 +37,6 @@ flag {
  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
    }
}

# OWNER=yomna TARGET=25Q4
flag {
    name: "vendor_specific_cellular_identifier_disclosure_indications"
+0 −20
Original line number Diff line number Diff line
@@ -3888,26 +3888,6 @@ public class ServiceStateTracker extends Handler {
            tm.setNetworkOperatorNumericForPhone(mPhone.getPhoneId(), operatorNumeric);

            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
                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.
                    localeOperator = null;
                }
            }
            if (isInvalidOperatorNumeric(localeOperator)) {
                for (CellIdentity cid : prioritizedCids) {
                    if (!TextUtils.isEmpty(cid.getPlmn())) {
+11 −41
Original line number Diff line number Diff line
@@ -129,7 +129,6 @@ public class ServiceStateTrackerTest extends TelephonyTest {
    // Mocked classes
    private ProxyController mProxyController;
    private Handler mTestHandler;
    private NetworkService mIwlanNetworkService;
    private INetworkService.Stub mIwlanNetworkServiceStub;
    private SubscriptionInfo mSubInfo;

@@ -144,7 +143,6 @@ public class ServiceStateTrackerTest extends TelephonyTest {
    private SignalStrengthController mSsc;

    private ServiceStateTracker sst;
    private ServiceStateTrackerTestHandler mSSTTestHandler;
    private PersistableBundle mBundle;
    private SatelliteController mSatelliteController;
    private EmergencyStateTracker mEmergencyStateTracker;
@@ -158,8 +156,6 @@ public class ServiceStateTrackerTest extends TelephonyTest {
    private static final int EVENT_DATA_RAT_CHANGED = 7;
    private static final int EVENT_PS_RESTRICT_ENABLED = 8;
    private static final int EVENT_PS_RESTRICT_DISABLED = 9;
    private static final int EVENT_VOICE_ROAMING_ON = 10;
    private static final int EVENT_VOICE_ROAMING_OFF = 11;
    private static final int EVENT_VOICE_RAT_CHANGED = 12;

    private static final int PHONE_ID = 0;
@@ -177,6 +173,9 @@ public class ServiceStateTrackerTest extends TelephonyTest {
            WIFI_CALLING_FLIGHT_MODE_FORMAT };

    private static final String HOME_PLMN = "310260";
    private static final String HOME_MCC = "310";
    private static final String HOME_MNC = "260";

    private static final String PLMN1 = "480123";
    private static final String PLMN2 = "586111";
    private static final String HOME_PNN = "home pnn";
@@ -187,35 +186,6 @@ public class ServiceStateTrackerTest extends TelephonyTest {
    };
    private static final String SATELLITE_DISPLAY_NAME = "SatelliteTest";

    private class ServiceStateTrackerTestHandler extends HandlerThread {

        private ServiceStateTrackerTestHandler(String name) {
            super(name);
        }

        @Override
        public void onLooperPrepared() {
            mSsc = new SignalStrengthController(mPhone);
            doReturn(mSsc).when(mPhone).getSignalStrengthController();

            // Capture listener registered for ServiceStateTracker to emulate the carrier config
            // change notification used later. In this test, it's the third one. The first one
            // comes from RatRatcheter and the second one comes from SignalStrengthController.
            ArgumentCaptor<CarrierConfigManager.CarrierConfigChangeListener>
                    listenerArgumentCaptor =
                            ArgumentCaptor.forClass(
                                    CarrierConfigManager.CarrierConfigChangeListener.class);
            sst = new ServiceStateTracker(mPhone, mSimulatedCommands, mFeatureFlags);
            verify(mCarrierConfigManager, atLeast(3)).registerCarrierConfigChangeListener(any(),
                    listenerArgumentCaptor.capture());
            mCarrierConfigChangeListener = listenerArgumentCaptor.getAllValues().get(2);

            sst.setServiceStateStats(mServiceStateStats);
            doReturn(sst).when(mPhone).getServiceStateTracker();
            setReady(true);
        }
    }

    private void addNetworkService() {
        mCellularNetworkService = new CellularNetworkService();
        ServiceInfo CellularServiceInfo = new ServiceInfo();
@@ -253,7 +223,6 @@ public class ServiceStateTrackerTest extends TelephonyTest {
        super.setUp(getClass().getSimpleName());
        mProxyController = Mockito.mock(ProxyController.class);
        mTestHandler = Mockito.mock(Handler.class);
        mIwlanNetworkService = Mockito.mock(NetworkService.class);
        mIwlanNetworkServiceStub = Mockito.mock(INetworkService.Stub.class);
        mSubInfo = Mockito.mock(SubscriptionInfo.class);
        mSubInfoInternal = new SubscriptionInfoInternal.Builder().setId(1).build();
@@ -2369,7 +2338,7 @@ public class ServiceStateTrackerTest extends TelephonyTest {
                new LteVopsSupportInfo(LteVopsSupportInfo.LTE_STATUS_NOT_AVAILABLE,
                        LteVopsSupportInfo.LTE_STATUS_NOT_AVAILABLE);
        CellIdentityLte cellIdentity =
                new CellIdentityLte(1, 1, 5, 1, new int[] {1, 2}, 5000, "001", "01", "test",
                new CellIdentityLte(1, 1, 5, 1, new int[] {1, 2}, 5000, HOME_MCC, HOME_MNC, "test",
                        "tst", Collections.emptyList(), null);
        if (!passCellId) {
            cellIdentity = null;
@@ -2380,7 +2349,6 @@ public class ServiceStateTrackerTest extends TelephonyTest {
                new AsyncResult(sst.mPollingContext, opNamesResult, null)));
        processAllMessages();


        // PS WWAN
        NetworkRegistrationInfo dataResult = new NetworkRegistrationInfo(
                NetworkRegistrationInfo.DOMAIN_PS, AccessNetworkConstants.TRANSPORT_TYPE_WWAN,
@@ -2408,7 +2376,6 @@ public class ServiceStateTrackerTest extends TelephonyTest {
        processAllMessages();
        assertEquals(opNamesResult[0], sst.getServiceState().getOperatorAlpha());
        assertEquals(opNamesResult[2], sst.getServiceState().getOperatorNumeric());
        verify(mLocaleTracker).updateOperatorNumeric(eq(opNamesResult[2]));
    }

    /**
@@ -2424,13 +2391,14 @@ public class ServiceStateTrackerTest extends TelephonyTest {
        changeRegStateWithIwlanOperatorNumeric(NetworkRegistrationInfo.REGISTRATION_STATE_HOME,
                TelephonyManager.NETWORK_TYPE_LTE,
                NetworkRegistrationInfo.REGISTRATION_STATE_HOME, OpNamesResult, true);
        verify(mLocaleTracker).updateOperatorNumeric(eq(OpNamesResult[2]));
        verify(mLocaleTracker).updateOperatorNumeric(eq(HOME_MCC + HOME_MNC));
        Mockito.clearInvocations(mLocaleTracker);
        changeRegStateWithIwlanOperatorNumeric(
                NetworkRegistrationInfo.REGISTRATION_STATE_NOT_REGISTERED_OR_SEARCHING,
                TelephonyManager.NETWORK_TYPE_LTE,
                NetworkRegistrationInfo.REGISTRATION_STATE_HOME, OpNamesResult, true);
        /* cellId based mccmnc */
        verify(mLocaleTracker).updateOperatorNumeric(eq("00101"));
        verify(mLocaleTracker).updateOperatorNumeric(eq(HOME_MCC + HOME_MNC));
        changeRegStateWithIwlanOperatorNumeric(
                NetworkRegistrationInfo.REGISTRATION_STATE_NOT_REGISTERED_OR_SEARCHING,
                TelephonyManager.NETWORK_TYPE_LTE,
@@ -2455,7 +2423,9 @@ public class ServiceStateTrackerTest extends TelephonyTest {
                NetworkRegistrationInfo.REGISTRATION_STATE_HOME,
                TelephonyManager.NETWORK_TYPE_LTE,
                NetworkRegistrationInfo.REGISTRATION_STATE_HOME, OpNamesResult, true);
        verify(mLocaleTracker).updateOperatorNumeric(eq(OpNamesResult[2]));
        verify(mLocaleTracker).updateOperatorNumeric(eq(HOME_MCC + HOME_MNC));

        clearInvocations(mLocaleTracker);

        // Test with Cellular as NOT_REG
        changeRegStateWithIwlanOperatorNumeric(
@@ -2463,7 +2433,7 @@ public class ServiceStateTrackerTest extends TelephonyTest {
                TelephonyManager.NETWORK_TYPE_UNKNOWN,
                NetworkRegistrationInfo.REGISTRATION_STATE_HOME, OpNamesResult, true);
        /* cellId based mccmnc */
        verify(mLocaleTracker).updateOperatorNumeric(eq("00101"));
        verify(mLocaleTracker).updateOperatorNumeric(eq(HOME_MCC + HOME_MNC));

        // IMS over Iwlan is registered.
        doReturn(mImsPhone)