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

Commit 016fa592 authored by Sarah Chin's avatar Sarah Chin
Browse files

Fix NR display logic for non-LTE RATs

Get the data network type from NetworkRegistrationInfo instead of from
ServiceState. Also explicitly check for LTE or LTE_CA before setting
the NR override network type. This prevents the case where the network
type could be IWLAN and the override network type is NR.

Test: atest NetworkTypeControllerTest
Bug: 178111905
Change-Id: Ic22c60f19b6cd2c7fc4388f27f2ef1aaaba2e66d
Merged-In: Ic22c60f19b6cd2c7fc4388f27f2ef1aaaba2e66d
parent 3a87d97a
Loading
Loading
Loading
Loading
+9 −4
Original line number Diff line number Diff line
@@ -352,11 +352,16 @@ public class NetworkTypeController extends StateMachine {

    private @Annotation.OverrideNetworkType int getCurrentOverrideNetworkType() {
        int displayNetworkType = TelephonyDisplayInfo.OVERRIDE_NETWORK_TYPE_NONE;
        int dataNetworkType = mPhone.getServiceState().getDataNetworkType();
        NetworkRegistrationInfo nri =  mPhone.getServiceState().getNetworkRegistrationInfo(
                NetworkRegistrationInfo.DOMAIN_PS, AccessNetworkConstants.TRANSPORT_TYPE_WWAN);
        int dataNetworkType = nri == null ? TelephonyManager.NETWORK_TYPE_UNKNOWN
                : nri.getAccessNetworkTechnology();
        boolean nrNsa = isLte(dataNetworkType)
                && mPhone.getServiceState().getNrState() != NetworkRegistrationInfo.NR_STATE_NONE;
        boolean nrSa = dataNetworkType == TelephonyManager.NETWORK_TYPE_NR;

        // NR display is not accurate when physical channel config notifications are off
        if (mIsPhysicalChannelConfigOn
                && (mPhone.getServiceState().getNrState() != NetworkRegistrationInfo.NR_STATE_NONE
                || dataNetworkType == TelephonyManager.NETWORK_TYPE_NR)) {
        if (mIsPhysicalChannelConfigOn && (nrNsa || nrSa)) {
            // Process NR display network type
            displayNetworkType = getNrDisplayType();
            if (displayNetworkType == TelephonyDisplayInfo.OVERRIDE_NETWORK_TYPE_NONE) {