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

Commit e9427d69 authored by Jack Yu's avatar Jack Yu Committed by Sarah Chin
Browse files

Allow TEMP_NOT_METERED on 5G SA network

Allow TEMP_NOT_METERED on 5G SA network for now. Note this
is just the temporary code for catching the unexpected temp
not metered flag on non-5G devices. This should be completely
removed after issue is fixed.

Bug: 176119724
Test: Manual
Change-Id: I750e8c271ca086d260d783f66fc0f8481bf31dd2
Merged-In: I750e8c271ca086d260d783f66fc0f8481bf31dd2
parent 6364c19f
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();
    }

    /**