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

Commit 9497afd1 authored by Srikanth Chintala's avatar Srikanth Chintala
Browse files

Use tcp buffer values for rat LTE_CA

- currently the tcp buffer values used are
the values for LTE, which are different
- only check new service state to decide
if carrier aggregation is used and use LTE_CA
rat if true

Bug: 77214748
Test: manual, check tcp buffer values for LTE_CA
Change-Id: If34638b9e7693873f0273e98480e1b41b9fd7a45
parent e5e89123
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -3197,7 +3197,13 @@ public class ServiceStateTracker extends Handler {
                    : TelephonyManager.NETWORK_TYPE_UNKNOWN;
            int newRAT = newNrs != null ? newNrs.getAccessNetworkTechnology()
                    : TelephonyManager.NETWORK_TYPE_UNKNOWN;
            hasRilDataRadioTechnologyChanged.put(transport, oldRAT != newRAT);

            boolean isOldCA = oldNrs != null ? (oldNrs.getDataSpecificInfo() != null
                    ? oldNrs.getDataSpecificInfo().isUsingCarrierAggregation() : false) : false;
            boolean isNewCA = newNrs!= null ? (newNrs. getDataSpecificInfo() != null
                    ? newNrs. getDataSpecificInfo().isUsingCarrierAggregation() : false) : false;

            hasRilDataRadioTechnologyChanged.put(transport, oldRAT != newRAT || isOldCA != isNewCA);
            if (oldRAT != newRAT) {
                anyDataRatChanged = true;
            }
+16 −6
Original line number Diff line number Diff line
@@ -1025,13 +1025,15 @@ public class DataConnection extends StateMachine {
            "122334,734003,2202010,32040,192239,576717";
    private static final String TCP_BUFFER_SIZES_NR =
            "2097152,6291456,16777216,512000,2097152,8388608";
    private static final String TCP_BUFFER_SIZES_LTE_CA =
            "4096,6291456,12582912,4096,1048576,2097152";

    private void updateTcpBufferSizes(int rilRat) {
        String sizes = null;
        if (rilRat == ServiceState.RIL_RADIO_TECHNOLOGY_LTE_CA) {
            // for now treat CA as LTE.  Plan to surface the extra bandwith in a more
            // precise manner which should affect buffer sizes
            rilRat = ServiceState.RIL_RADIO_TECHNOLOGY_LTE;
        ServiceState ss = mPhone.getServiceState();
        if (rilRat == ServiceState.RIL_RADIO_TECHNOLOGY_LTE &&
                ss.isUsingCarrierAggregation()) {
            rilRat = ServiceState.RIL_RADIO_TECHNOLOGY_LTE_CA;
        }
        String ratName = ServiceState.rilRadioTechnologyToString(rilRat).toLowerCase(Locale.ROOT);
        // ServiceState gives slightly different names for EVDO tech ("evdo-rev.0" for ex)
@@ -1045,7 +1047,8 @@ public class DataConnection extends StateMachine {
        // NR 5G Non-Standalone use LTE cell as the primary cell, the ril technology is LTE in this
        // case. We use NR 5G TCP buffer size when connected to NR 5G Non-Standalone network.
        if (mTransportType == AccessNetworkConstants.TRANSPORT_TYPE_WWAN
                && rilRat == ServiceState.RIL_RADIO_TECHNOLOGY_LTE && isNRConnected()
                && ((rilRat == ServiceState.RIL_RADIO_TECHNOLOGY_LTE ||
                rilRat == ServiceState.RIL_RADIO_TECHNOLOGY_LTE_CA) && isNRConnected())
                && mPhone.getServiceStateTracker().getNrContextIds().contains(mCid)) {
            ratName = RAT_NAME_5G;
        }
@@ -1096,7 +1099,6 @@ public class DataConnection extends StateMachine {
                    sizes = TCP_BUFFER_SIZES_HSPA;
                    break;
                case ServiceState.RIL_RADIO_TECHNOLOGY_LTE:
                case ServiceState.RIL_RADIO_TECHNOLOGY_LTE_CA:
                    // Use NR 5G TCP buffer size when connected to NR 5G Non-Standalone network.
                    if (RAT_NAME_5G.equals(ratName)) {
                        sizes = TCP_BUFFER_SIZES_NR;
@@ -1104,6 +1106,14 @@ public class DataConnection extends StateMachine {
                        sizes = TCP_BUFFER_SIZES_LTE;
                    }
                    break;
                case ServiceState.RIL_RADIO_TECHNOLOGY_LTE_CA:
                    // Use NR 5G TCP buffer size when connected to NR 5G Non-Standalone network.
                    if (RAT_NAME_5G.equals(ratName)) {
                        sizes = TCP_BUFFER_SIZES_NR;
                    } else {
                        sizes = TCP_BUFFER_SIZES_LTE_CA;
                    }
                    break;
                case ServiceState.RIL_RADIO_TECHNOLOGY_HSPAP:
                    sizes = TCP_BUFFER_SIZES_HSPAP;
                    break;