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

Commit 9c37d93c authored by Sarah Chin's avatar Sarah Chin Committed by Gerrit Code Review
Browse files

Merge "Use cached preferred network type for 5G icon"

parents 0547b844 397059fc
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -356,6 +356,11 @@ 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) {
            return TelephonyDisplayInfo.OVERRIDE_NETWORK_TYPE_NONE;
        }
        // Icon display keys in order of priority
        List<String> keys = new ArrayList<>();
        // TODO: Update for NR SA
+12 −1
Original line number Diff line number Diff line
@@ -2193,6 +2193,17 @@ public abstract class Phone extends Handler implements PhoneInternalInterface {
        mCi.getPreferredNetworkType(response);
    }

    /**
     * Get the cached value of the preferred network type setting
     */
    public int getCachedPreferredNetworkType() {
        if (mCi != null && mCi instanceof BaseCommands) {
            return ((BaseCommands) mCi).mPreferredNetworkType;
        } else {
            return RILConstants.PREFERRED_NETWORK_MODE;
        }
    }

    /**
     * Gets the default SMSC address.
     *
+2 −0
Original line number Diff line number Diff line
@@ -88,6 +88,8 @@ public class NetworkTypeControllerTest extends TelephonyTest {
        broadcastCarrierConfigs();

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