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

Commit c443acd7 authored by sangyun's avatar sangyun Committed by Jack Yu
Browse files

Explicitly use overridden or non-overridden roaming state.

- Deliver the overridden boolean isRoaming to TelephonyDisplayInfo.
- Use the non-overridden registration state from network instead of
  the initial registration state.

Bug: 260017781
Test: atest DisplayInfoControllerTest
Merged-In: I1e54aafcca9e720d9a9fe718553e6f13cef1922b
Change-Id: I1e54aafcca9e720d9a9fe718553e6f13cef1922b
parent 65042c69
Loading
Loading
Loading
Loading
+25 −1
Original line number Original line Diff line number Diff line
@@ -18,11 +18,13 @@ package com.android.internal.telephony;


import android.annotation.NonNull;
import android.annotation.NonNull;
import android.os.Handler;
import android.os.Handler;
import android.os.Message;
import android.os.Registrant;
import android.os.Registrant;
import android.os.RegistrantList;
import android.os.RegistrantList;
import android.telephony.AccessNetworkConstants;
import android.telephony.AccessNetworkConstants;
import android.telephony.AnomalyReporter;
import android.telephony.AnomalyReporter;
import android.telephony.NetworkRegistrationInfo;
import android.telephony.NetworkRegistrationInfo;
import android.telephony.ServiceState;
import android.telephony.TelephonyDisplayInfo;
import android.telephony.TelephonyDisplayInfo;
import android.telephony.TelephonyManager;
import android.telephony.TelephonyManager;
import android.util.IndentingPrintWriter;
import android.util.IndentingPrintWriter;
@@ -66,10 +68,14 @@ public class DisplayInfoController extends Handler {
                    TelephonyDisplayInfo.OVERRIDE_NETWORK_TYPE_NR_ADVANCED)
                    TelephonyDisplayInfo.OVERRIDE_NETWORK_TYPE_NR_ADVANCED)
            );
            );


    /** Event for service state changed (roaming). */
    private static final int EVENT_SERVICE_STATE_CHANGED = 1;

    private final Phone mPhone;
    private final Phone mPhone;
    private final NetworkTypeController mNetworkTypeController;
    private final NetworkTypeController mNetworkTypeController;
    private final RegistrantList mTelephonyDisplayInfoChangedRegistrants = new RegistrantList();
    private final RegistrantList mTelephonyDisplayInfoChangedRegistrants = new RegistrantList();
    private @NonNull TelephonyDisplayInfo mTelephonyDisplayInfo;
    private @NonNull TelephonyDisplayInfo mTelephonyDisplayInfo;
    private @NonNull ServiceState mServiceState;


    public DisplayInfoController(Phone phone) {
    public DisplayInfoController(Phone phone) {
        mPhone = phone;
        mPhone = phone;
@@ -79,6 +85,13 @@ public class DisplayInfoController extends Handler {
                TelephonyDisplayInfo.OVERRIDE_NETWORK_TYPE_NONE);
                TelephonyDisplayInfo.OVERRIDE_NETWORK_TYPE_NONE);
        mNetworkTypeController = new NetworkTypeController(phone, this);
        mNetworkTypeController = new NetworkTypeController(phone, this);
        mNetworkTypeController.sendMessage(NetworkTypeController.EVENT_UPDATE);
        mNetworkTypeController.sendMessage(NetworkTypeController.EVENT_UPDATE);

        mServiceState = mPhone.getServiceStateTracker().getServiceState();
        post(() -> {
            mPhone.getServiceStateTracker()
                    .registerForServiceStateChanged(this, EVENT_SERVICE_STATE_CHANGED, null);
            updateTelephonyDisplayInfo();
        });
    }
    }


    /**
    /**
@@ -98,7 +111,7 @@ public class DisplayInfoController extends Handler {
        int dataNetworkType = nri == null ? TelephonyManager.NETWORK_TYPE_UNKNOWN
        int dataNetworkType = nri == null ? TelephonyManager.NETWORK_TYPE_UNKNOWN
                : nri.getAccessNetworkTechnology();
                : nri.getAccessNetworkTechnology();
        TelephonyDisplayInfo newDisplayInfo = new TelephonyDisplayInfo(dataNetworkType,
        TelephonyDisplayInfo newDisplayInfo = new TelephonyDisplayInfo(dataNetworkType,
                mNetworkTypeController.getOverrideNetworkType());
                mNetworkTypeController.getOverrideNetworkType(), mServiceState.getRoaming());
        if (!newDisplayInfo.equals(mTelephonyDisplayInfo)) {
        if (!newDisplayInfo.equals(mTelephonyDisplayInfo)) {
            logl("TelephonyDisplayInfo changed from " + mTelephonyDisplayInfo + " to "
            logl("TelephonyDisplayInfo changed from " + mTelephonyDisplayInfo + " to "
                    + newDisplayInfo);
                    + newDisplayInfo);
@@ -160,6 +173,17 @@ public class DisplayInfoController extends Handler {
        mTelephonyDisplayInfoChangedRegistrants.remove(h);
        mTelephonyDisplayInfoChangedRegistrants.remove(h);
    }
    }


    @Override
    public void handleMessage(@NonNull Message msg) {
        switch (msg.what) {
            case EVENT_SERVICE_STATE_CHANGED:
                mServiceState = mPhone.getServiceStateTracker().getServiceState();
                log("ServiceState updated, isRoaming=" + mServiceState.getRoaming());
                updateTelephonyDisplayInfo();
                break;
        }
    }

    /**
    /**
     * Log debug messages.
     * Log debug messages.
     * @param s debug messages
     * @param s debug messages
+7 −7
Original line number Original line Diff line number Diff line
@@ -910,7 +910,7 @@ public class ServiceStateTracker extends Handler {
        if (nrs != null) {
        if (nrs != null) {
            int rat = ServiceState.networkTypeToRilRadioTechnology(
            int rat = ServiceState.networkTypeToRilRadioTechnology(
                    nrs.getAccessNetworkTechnology());
                    nrs.getAccessNetworkTechnology());
            int drs = regCodeToServiceState(nrs.getInitialRegistrationState());
            int drs = regCodeToServiceState(nrs.getNetworkRegistrationState());
            return new Pair<>(drs, rat);
            return new Pair<>(drs, rat);
        }
        }
        return null;
        return null;
@@ -2171,14 +2171,14 @@ public class ServiceStateTracker extends Handler {
        if (wlanPsRegState != null
        if (wlanPsRegState != null
                && wlanPsRegState.getAccessNetworkTechnology()
                && wlanPsRegState.getAccessNetworkTechnology()
                == TelephonyManager.NETWORK_TYPE_IWLAN
                == TelephonyManager.NETWORK_TYPE_IWLAN
                && wlanPsRegState.getInitialRegistrationState()
                && wlanPsRegState.getNetworkRegistrationState()
                == NetworkRegistrationInfo.REGISTRATION_STATE_HOME
                == NetworkRegistrationInfo.REGISTRATION_STATE_HOME
                && isIwlanPreferred) {
                && isIwlanPreferred) {
            serviceState.setDataRegState(ServiceState.STATE_IN_SERVICE);
            serviceState.setDataRegState(ServiceState.STATE_IN_SERVICE);
        } else if (wwanPsRegState != null) {
        } else if (wwanPsRegState != null) {
            // If the device is not camped on IWLAN, then we use cellular PS registration state
            // If the device is not camped on IWLAN, then we use cellular PS registration state
            // to compute reg state and rat.
            // to compute reg state and rat.
            int regState = wwanPsRegState.getInitialRegistrationState();
            int regState = wwanPsRegState.getNetworkRegistrationState();
            serviceState.setDataRegState(regCodeToServiceState(regState));
            serviceState.setDataRegState(regCodeToServiceState(regState));
        }
        }
        if (DBG) {
        if (DBG) {
@@ -2194,7 +2194,7 @@ public class ServiceStateTracker extends Handler {
                VoiceSpecificRegistrationInfo voiceSpecificStates =
                VoiceSpecificRegistrationInfo voiceSpecificStates =
                        networkRegState.getVoiceSpecificInfo();
                        networkRegState.getVoiceSpecificInfo();


                int registrationState = networkRegState.getInitialRegistrationState();
                int registrationState = networkRegState.getNetworkRegistrationState();
                int cssIndicator = voiceSpecificStates.cssSupported ? 1 : 0;
                int cssIndicator = voiceSpecificStates.cssSupported ? 1 : 0;
                int newVoiceRat = ServiceState.networkTypeToRilRadioTechnology(
                int newVoiceRat = ServiceState.networkTypeToRilRadioTechnology(
                        networkRegState.getAccessNetworkTechnology());
                        networkRegState.getAccessNetworkTechnology());
@@ -2276,7 +2276,7 @@ public class ServiceStateTracker extends Handler {
                mNewSS.addNetworkRegistrationInfo(networkRegState);
                mNewSS.addNetworkRegistrationInfo(networkRegState);
                DataSpecificRegistrationInfo dataSpecificStates =
                DataSpecificRegistrationInfo dataSpecificStates =
                        networkRegState.getDataSpecificInfo();
                        networkRegState.getDataSpecificInfo();
                int registrationState = networkRegState.getInitialRegistrationState();
                int registrationState = networkRegState.getNetworkRegistrationState();
                int serviceState = regCodeToServiceState(registrationState);
                int serviceState = regCodeToServiceState(registrationState);
                int newDataRat = ServiceState.networkTypeToRilRadioTechnology(
                int newDataRat = ServiceState.networkTypeToRilRadioTechnology(
                        networkRegState.getAccessNetworkTechnology());
                        networkRegState.getAccessNetworkTechnology());
@@ -3526,9 +3526,9 @@ public class ServiceStateTracker extends Handler {
                anyDataRatChanged = true;
                anyDataRatChanged = true;
            }
            }


            int oldRegState = oldNrs != null ? oldNrs.getInitialRegistrationState()
            int oldRegState = oldNrs != null ? oldNrs.getNetworkRegistrationState()
                    : NetworkRegistrationInfo.REGISTRATION_STATE_UNKNOWN;
                    : NetworkRegistrationInfo.REGISTRATION_STATE_UNKNOWN;
            int newRegState = newNrs != null ? newNrs.getInitialRegistrationState()
            int newRegState = newNrs != null ? newNrs.getNetworkRegistrationState()
                    : NetworkRegistrationInfo.REGISTRATION_STATE_UNKNOWN;
                    : NetworkRegistrationInfo.REGISTRATION_STATE_UNKNOWN;
            hasDataRegStateChanged.put(transport, oldRegState != newRegState);
            hasDataRegStateChanged.put(transport, oldRegState != newRegState);
            if (oldRegState != newRegState) {
            if (oldRegState != newRegState) {
+280 −0
Original line number Original line Diff line number Diff line
/*
 * Copyright (C) 2020 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.android.internal.telephony;

import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import static org.mockito.ArgumentMatchers.anyInt;
import static org.mockito.Mockito.doReturn;
import static org.mockito.Mockito.eq;
import static org.mockito.Mockito.when;

import android.content.Context;
import android.content.Intent;
import android.os.AsyncResult;
import android.os.HandlerThread;
import android.os.PersistableBundle;
import android.telephony.AccessNetworkConstants;
import android.telephony.CarrierConfigManager;
import android.telephony.CellIdentity;
import android.telephony.CellIdentityCdma;
import android.telephony.CellIdentityLte;
import android.telephony.LteVopsSupportInfo;
import android.telephony.NetworkRegistrationInfo;
import android.telephony.ServiceState;
import android.telephony.TelephonyDisplayInfo;
import android.telephony.TelephonyManager;
import android.testing.AndroidTestingRunner;
import android.testing.TestableLooper;
import android.text.TextUtils;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mockito;

import java.util.Collections;

@RunWith(AndroidTestingRunner.class)
@TestableLooper.RunWithLooper
public class DisplayInfoControllerTest extends TelephonyTest {

    private static final int PHONE_ID = 0;
    private static final String MCC = "600";
    private static final String MNC = "01";
    private static final String NUMERIC = MCC + MNC;
    private static final String NETWORK = "TestNet";

    private DisplayInfoController mDic;
    private ServiceStateTracker mSst;
    private ServiceStateTrackerTestHandler mSstHandler;
    private SignalStrengthController mSsc;
    private PersistableBundle mBundle;

    private class ServiceStateTrackerTestHandler extends HandlerThread {
        private ServiceStateTrackerTestHandler(String name) {
            super(name);
        }

        @Override
        public void onLooperPrepared() {
            mSsc = new SignalStrengthController(mPhone);
            doReturn(mSsc).when(mPhone).getSignalStrengthController();
            doReturn(new ServiceState()).when(mPhone).getServiceState();
            doReturn(NUMERIC).when(mTelephonyManager).getSimOperatorNumericForPhone(eq(PHONE_ID));
            doReturn(NETWORK).when(mTelephonyManager).getSimOperatorNameForPhone(eq(PHONE_ID));

            mSst = new ServiceStateTracker(mPhone, mSimulatedCommands);
            doReturn(mSst).when(mPhone).getServiceStateTracker();
            setReady(true);
        }
    }

    @Before
    public void setUp() throws Exception {
        logd("DisplayInfoControllerTest setup!");
        super.setUp(getClass().getSimpleName());

        mSstHandler = new ServiceStateTrackerTestHandler(getClass().getSimpleName());
        mSstHandler.start();
        waitUntilReady();
        waitForLastHandlerAction(mSstHandler.getThreadHandler());
    }

    @After
    public void tearDown() throws Exception {
        mSst.removeCallbacksAndMessages(null);
        mSst = null;
        mSstHandler.quit();
        mSstHandler.join();
        mSstHandler = null;
        mBundle = null;
        super.tearDown();
    }

    private void sendCarrierConfigUpdate() {
        CarrierConfigManager mockConfigManager = Mockito.mock(CarrierConfigManager.class);
        when(mContext.getSystemService(Context.CARRIER_CONFIG_SERVICE))
                .thenReturn(mockConfigManager);
        when(mockConfigManager.getConfigForSubId(anyInt())).thenReturn(mBundle);

        Intent intent = new Intent().setAction(CarrierConfigManager.ACTION_CARRIER_CONFIG_CHANGED);
        intent.putExtra(CarrierConfigManager.EXTRA_SLOT_INDEX, PHONE_ID);
        mContext.sendBroadcast(intent);
        waitForLastHandlerAction(mSstHandler.getThreadHandler());
    }

    private static String getPlmnFromCellIdentity(final CellIdentity ci) {
        if (ci == null || ci instanceof CellIdentityCdma) return "";

        final String mcc = ci.getMccString();
        final String mnc = ci.getMncString();

        if (TextUtils.isEmpty(mcc) || TextUtils.isEmpty(mnc)) return "";

        return mcc + mnc;
    }

    private void changeRegState(int state) {
        int voiceRat = TelephonyManager.NETWORK_TYPE_LTE;
        int dataRat = TelephonyManager.NETWORK_TYPE_LTE;
        CellIdentityLte cid =
                new CellIdentityLte(1, 1, 5, 1, new int[] {1, 2}, 5000,
                        MCC, MNC, NETWORK, NETWORK, Collections.emptyList(), null);
        LteVopsSupportInfo lteVopsSupportInfo =
                new LteVopsSupportInfo(
                        LteVopsSupportInfo.LTE_STATUS_SUPPORTED,
                        LteVopsSupportInfo.LTE_STATUS_SUPPORTED);
        waitForLastHandlerAction(mSstHandler.getThreadHandler());
        NetworkRegistrationInfo dataResult = new NetworkRegistrationInfo(
                NetworkRegistrationInfo.DOMAIN_PS, AccessNetworkConstants.TRANSPORT_TYPE_WWAN,
                state, dataRat, 0, false, null, cid, getPlmnFromCellIdentity(cid), 1, false, false,
                false, lteVopsSupportInfo);
        mSst.mPollingContext[0] = 3;
        final String[] oldOpNamesResult = new String[] {"test", "test", NUMERIC};
        mSst.sendMessage(
                mSst.obtainMessage(
                        ServiceStateTracker.EVENT_POLL_STATE_OPERATOR,
                        new AsyncResult(mSst.mPollingContext, oldOpNamesResult, null)));
        waitForLastHandlerAction(mSstHandler.getThreadHandler());
        // update data reg state to be in service
        mSst.sendMessage(
                mSst.obtainMessage(
                        ServiceStateTracker.EVENT_POLL_STATE_PS_CELLULAR_REGISTRATION,
                        new AsyncResult(mSst.mPollingContext, dataResult, null)));
        waitForLastHandlerAction(mSstHandler.getThreadHandler());
        NetworkRegistrationInfo voiceResult = new NetworkRegistrationInfo(
                NetworkRegistrationInfo.DOMAIN_CS, AccessNetworkConstants.TRANSPORT_TYPE_WWAN,
                state, voiceRat, 0, false, null, cid, getPlmnFromCellIdentity(cid), false, 0, 0, 0);
        mSst.sendMessage(
                mSst.obtainMessage(
                        ServiceStateTracker.EVENT_POLL_STATE_CS_CELLULAR_REGISTRATION,
                        new AsyncResult(mSst.mPollingContext, voiceResult, null)));
        waitForLastHandlerAction(mSstHandler.getThreadHandler());
    }

    @Test
    public void testIsRoamingOverride_NonRoamingOperator() {
        doReturn(true).when(mPhone).isPhoneTypeGsm();

        mBundle = mContextFixture.getCarrierConfigBundle();
        mBundle.putStringArray(
                CarrierConfigManager.KEY_NON_ROAMING_OPERATOR_STRING_ARRAY, new String[] {NUMERIC});
        sendCarrierConfigUpdate();

        changeRegState(NetworkRegistrationInfo.REGISTRATION_STATE_ROAMING);
        ServiceState ss = mSst.getServiceState();

        assertFalse(ss.getRoaming()); // home

        doReturn(mSst).when(mPhone).getServiceStateTracker();
        mDic = new DisplayInfoController(mPhone);
        mDic.updateTelephonyDisplayInfo();
        TelephonyDisplayInfo tdi = mDic.getTelephonyDisplayInfo();

        assertFalse(tdi.isRoaming());
    }

    @Test
    public void testIsRoamingOverride_ForceHomeNetwork() {
        doReturn(true).when(mPhone).isPhoneTypeGsm();

        mBundle = mContextFixture.getCarrierConfigBundle();
        mBundle.putBoolean(CarrierConfigManager.KEY_FORCE_HOME_NETWORK_BOOL, true);
        sendCarrierConfigUpdate();

        changeRegState(NetworkRegistrationInfo.REGISTRATION_STATE_ROAMING);
        ServiceState ss = mSst.getServiceState();

        assertFalse(ss.getRoaming()); // home

        doReturn(mSst).when(mPhone).getServiceStateTracker();
        mDic = new DisplayInfoController(mPhone);
        mDic.updateTelephonyDisplayInfo();
        TelephonyDisplayInfo tdi = mDic.getTelephonyDisplayInfo();

        assertFalse(tdi.isRoaming());
    }

    @Test
    public void testIsRoamingOverride_RoamingOperator() {
        doReturn(true).when(mPhone).isPhoneTypeGsm();

        mBundle = mContextFixture.getCarrierConfigBundle();
        mBundle.putStringArray(
                CarrierConfigManager.KEY_ROAMING_OPERATOR_STRING_ARRAY, new String[] {"60101"});
        sendCarrierConfigUpdate();

        changeRegState(NetworkRegistrationInfo.REGISTRATION_STATE_ROAMING);
        ServiceState ss1 = mSst.getServiceState();

        assertTrue(ss1.getRoaming()); // roam

        doReturn(mSst).when(mPhone).getServiceStateTracker();
        mDic = new DisplayInfoController(mPhone);
        mDic.updateTelephonyDisplayInfo();
        TelephonyDisplayInfo tdi = mDic.getTelephonyDisplayInfo();

        assertTrue(tdi.isRoaming());
    }

    @Test
    public void testIsRoamingOverride_NonRoamingGsmOperator() {
        doReturn(true).when(mPhone).isPhoneTypeGsm();

        mBundle = mContextFixture.getCarrierConfigBundle();
        mBundle.putStringArray(
                CarrierConfigManager.KEY_GSM_NONROAMING_NETWORKS_STRING_ARRAY,
                new String[] {NUMERIC});
        sendCarrierConfigUpdate();

        changeRegState(NetworkRegistrationInfo.REGISTRATION_STATE_ROAMING);
        ServiceState ss = mSst.getServiceState();

        assertFalse(ss.getRoaming()); // home

        doReturn(mSst).when(mPhone).getServiceStateTracker();
        mDic = new DisplayInfoController(mPhone);
        mDic.updateTelephonyDisplayInfo();
        TelephonyDisplayInfo tdi = mDic.getTelephonyDisplayInfo();

        assertFalse(tdi.isRoaming());
    }

    @Test
    public void testIsRoamingOverride_RoamingGsmOperator() {
        doReturn(true).when(mPhone).isPhoneTypeGsm();

        mBundle = mContextFixture.getCarrierConfigBundle();
        mBundle.putStringArray(
                CarrierConfigManager.KEY_GSM_ROAMING_NETWORKS_STRING_ARRAY, new String[] {NUMERIC});
        sendCarrierConfigUpdate();

        changeRegState(NetworkRegistrationInfo.REGISTRATION_STATE_HOME);
        ServiceState ss1 = mSst.getServiceState();

        assertTrue(ss1.getRoaming()); // roam

        doReturn(mSst).when(mPhone).getServiceStateTracker();
        mDic = new DisplayInfoController(mPhone);
        mDic.updateTelephonyDisplayInfo();
        TelephonyDisplayInfo tdi = mDic.getTelephonyDisplayInfo();

        assertTrue(tdi.isRoaming());
    }
}
+1 −1
Original line number Original line Diff line number Diff line
@@ -85,6 +85,6 @@ public class NetworkRegistrationInfoTest {
        nri.setRoamingType(ServiceState.ROAMING_TYPE_NOT_ROAMING);
        nri.setRoamingType(ServiceState.ROAMING_TYPE_NOT_ROAMING);
        assertEquals(NetworkRegistrationInfo.REGISTRATION_STATE_HOME, nri.getRegistrationState());
        assertEquals(NetworkRegistrationInfo.REGISTRATION_STATE_HOME, nri.getRegistrationState());
        assertEquals(NetworkRegistrationInfo.REGISTRATION_STATE_ROAMING,
        assertEquals(NetworkRegistrationInfo.REGISTRATION_STATE_ROAMING,
                nri.getInitialRegistrationState());
                nri.getNetworkRegistrationState());
    }
    }
}
}
+10 −5
Original line number Original line Diff line number Diff line
@@ -1070,7 +1070,8 @@ public class TelephonyRegistryTest extends TelephonyTest {
                anyString(), any())).thenReturn(true);
                anyString(), any())).thenReturn(true);
        TelephonyDisplayInfo displayInfo = new TelephonyDisplayInfo(
        TelephonyDisplayInfo displayInfo = new TelephonyDisplayInfo(
                TelephonyManager.NETWORK_TYPE_LTE,
                TelephonyManager.NETWORK_TYPE_LTE,
                TelephonyDisplayInfo.OVERRIDE_NETWORK_TYPE_NR_ADVANCED);
                TelephonyDisplayInfo.OVERRIDE_NETWORK_TYPE_NR_ADVANCED,
                false);


        // Notify with invalid subId on default phone. Should NOT trigger callback.
        // Notify with invalid subId on default phone. Should NOT trigger callback.
        mTelephonyRegistry.notifyDisplayInfoChanged(0, INVALID_SUBSCRIPTION_ID, displayInfo);
        mTelephonyRegistry.notifyDisplayInfoChanged(0, INVALID_SUBSCRIPTION_ID, displayInfo);
@@ -1096,10 +1097,12 @@ public class TelephonyRegistryTest extends TelephonyTest {
                anyString(), any())).thenReturn(false);
                anyString(), any())).thenReturn(false);
        TelephonyDisplayInfo displayInfo = new TelephonyDisplayInfo(
        TelephonyDisplayInfo displayInfo = new TelephonyDisplayInfo(
                TelephonyManager.NETWORK_TYPE_LTE,
                TelephonyManager.NETWORK_TYPE_LTE,
                TelephonyDisplayInfo.OVERRIDE_NETWORK_TYPE_NR_ADVANCED);
                TelephonyDisplayInfo.OVERRIDE_NETWORK_TYPE_NR_ADVANCED,
                false);
        TelephonyDisplayInfo expectDisplayInfo = new TelephonyDisplayInfo(
        TelephonyDisplayInfo expectDisplayInfo = new TelephonyDisplayInfo(
                TelephonyManager.NETWORK_TYPE_LTE,
                TelephonyManager.NETWORK_TYPE_LTE,
                TelephonyDisplayInfo.OVERRIDE_NETWORK_TYPE_NR_NSA_MMWAVE);
                TelephonyDisplayInfo.OVERRIDE_NETWORK_TYPE_NR_NSA_MMWAVE,
                false);


        // Notify with invalid subId on default phone. Should NOT trigger callback.
        // Notify with invalid subId on default phone. Should NOT trigger callback.
        mTelephonyRegistry.notifyDisplayInfoChanged(0, INVALID_SUBSCRIPTION_ID, displayInfo);
        mTelephonyRegistry.notifyDisplayInfoChanged(0, INVALID_SUBSCRIPTION_ID, displayInfo);
@@ -1121,10 +1124,12 @@ public class TelephonyRegistryTest extends TelephonyTest {
        int[] events = {TelephonyCallback.EVENT_DISPLAY_INFO_CHANGED};
        int[] events = {TelephonyCallback.EVENT_DISPLAY_INFO_CHANGED};
        TelephonyDisplayInfo displayInfo = new TelephonyDisplayInfo(
        TelephonyDisplayInfo displayInfo = new TelephonyDisplayInfo(
                TelephonyManager.NETWORK_TYPE_LTE,
                TelephonyManager.NETWORK_TYPE_LTE,
                TelephonyDisplayInfo.OVERRIDE_NETWORK_TYPE_NR_ADVANCED);
                TelephonyDisplayInfo.OVERRIDE_NETWORK_TYPE_NR_ADVANCED,
                false);
        TelephonyDisplayInfo expectDisplayInfo = new TelephonyDisplayInfo(
        TelephonyDisplayInfo expectDisplayInfo = new TelephonyDisplayInfo(
                TelephonyManager.NETWORK_TYPE_LTE,
                TelephonyManager.NETWORK_TYPE_LTE,
                TelephonyDisplayInfo.OVERRIDE_NETWORK_TYPE_NR_NSA_MMWAVE);
                TelephonyDisplayInfo.OVERRIDE_NETWORK_TYPE_NR_NSA_MMWAVE,
                false);
        TelephonyCallback telephonyCallback2 = new TelephonyCallbackWrapper() {
        TelephonyCallback telephonyCallback2 = new TelephonyCallbackWrapper() {
            @Override
            @Override
            public void onDisplayInfoChanged(TelephonyDisplayInfo displayInfoNotify) {
            public void onDisplayInfoChanged(TelephonyDisplayInfo displayInfoNotify) {
Loading