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

Commit 6be17fa4 authored by Sarah Chin's avatar Sarah Chin Committed by Automerger Merge Worker
Browse files

Merge "Allow TEMP_NOT_METERED on 5G SA network" am: abc1ec21

Original change: https://android-review.googlesource.com/c/platform/frameworks/opt/telephony/+/1571050

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: If7f25cb0e20af8f3a50935b81fe030b15e0967ba
parents 03c5ad39 abc1ec21
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();
    }

    /**