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

Commit ac8899fc authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "Preferred network mode transform to BitMask type."

parents c5486668 a8dba349
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -28,6 +28,7 @@ import android.telephony.Annotation;
import android.telephony.CarrierConfigManager;
import android.telephony.NetworkRegistrationInfo;
import android.telephony.PhoneStateListener;
import android.telephony.RadioAccessFamily;
import android.telephony.ServiceState;
import android.telephony.SubscriptionManager;
import android.telephony.TelephonyDisplayInfo;
@@ -357,8 +358,8 @@ public class NetworkTypeController extends StateMachine {

    private @Annotation.OverrideNetworkType int getNrDisplayType() {
        // Don't show 5G icon if preferred network type does not include 5G
        if ((mPhone.getCachedPreferredNetworkType() & TelephonyManager.NETWORK_TYPE_BITMASK_NR)
                == 0) {
        if ((RadioAccessFamily.getRafFromNetworkType(mPhone.getCachedPreferredNetworkType())
                & TelephonyManager.NETWORK_TYPE_BITMASK_NR) == 0) {
            return TelephonyDisplayInfo.OVERRIDE_NETWORK_TYPE_NONE;
        }
        // Icon display keys in order of priority
+1 −1
Original line number Diff line number Diff line
@@ -88,7 +88,7 @@ public class NetworkTypeControllerTest extends TelephonyTest {
        broadcastCarrierConfigs();

        replaceInstance(Handler.class, "mLooper", mDisplayInfoController, Looper.myLooper());
        doReturn((int) TelephonyManager.NETWORK_TYPE_BITMASK_NR).when(mPhone)
        doReturn((int) TelephonyManager.NETWORK_MODE_NR_LTE_CDMA_EVDO_GSM_WCDMA).when(mPhone)
                .getCachedPreferredNetworkType();
        mNetworkTypeController = new NetworkTypeController(mPhone, mDisplayInfoController);
    }