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

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

Merge "Allow TEMP_NOT_METERED on 5G SA network"

parents 6364c19f e9427d69
Loading
Loading
Loading
Loading
+6 −4
Original line number Diff line number Diff line
@@ -1588,15 +1588,17 @@ public class DataConnection extends StateMachine {
    // NET_CAPABILITY_TEMPORARILY_NOT_METERED incorrectly set on devices that are not supposed
    // to use 5G unmetered network. Currently TEMPORARILY_NOT_METERED can only happen on few devices
    // and carriers.
    private boolean isCampedOn5GNsa() {
    private boolean isCampedOn5G() {
        TelephonyDisplayInfo displayInfo = mPhone.getDisplayInfoController()
                .getTelephonyDisplayInfo();
        int overrideNetworkType = displayInfo.getOverrideNetworkType();
        int networkType = mPhone.getServiceState().getDataNetworkType();
        return (networkType == TelephonyManager.NETWORK_TYPE_LTE
        return networkType == TelephonyManager.NETWORK_TYPE_NR
                || ((networkType == TelephonyManager.NETWORK_TYPE_LTE
                || networkType == TelephonyManager.NETWORK_TYPE_LTE_CA)
                && (overrideNetworkType == TelephonyDisplayInfo.OVERRIDE_NETWORK_TYPE_NR_NSA
                || overrideNetworkType == TelephonyDisplayInfo.OVERRIDE_NETWORK_TYPE_NR_NSA_MMWAVE);
                || overrideNetworkType
                == TelephonyDisplayInfo.OVERRIDE_NETWORK_TYPE_NR_NSA_MMWAVE));
    }

    // TODO: Remove this after b/176119724 is fixed. This is just a workaround to prevent
@@ -1604,7 +1606,7 @@ public class DataConnection extends StateMachine {
    // to use 5G unmetered network. Currently TEMPORARILY_NOT_METERED can only happen on few devices
    // and carriers.
    private boolean tempNotMeteredPossible() {
        return isDevice5GCapable() && isTempNotMeteredSupportedByCarrier() && isCampedOn5GNsa();
        return isDevice5GCapable() && isTempNotMeteredSupportedByCarrier() && isCampedOn5G();
    }

    /**