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

Commit aa26833e authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Fixed the incorrect MTU value" into tm-dev

parents 181e72ca 3423e7c5
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -2174,8 +2174,8 @@ public class DataNetwork extends StateMachine {

        // LinkProperties.setMtu should be deprecated. The mtu for each route has been already
        // provided in addRoute() above. For backwards compatibility, we still need to provide
        // a value for the legacy MTU. Use the lower value of v4 and v6 value here.
        linkProperties.setMtu(Math.min(mtuV4, mtuV6));
        // a value for the legacy MTU. Use the higher value of v4 and v6 value here.
        linkProperties.setMtu(Math.max(mtuV4, mtuV6));

        if (mDataProfile.getApnSetting() != null
                && !TextUtils.isEmpty(mDataProfile.getApnSetting().getProxyAddressAsString())) {
+12 −3
Original line number Diff line number Diff line
@@ -214,9 +214,8 @@ public class DataNetworkTest extends TelephonyTest {
                            InetAddresses.parseNumericAddress("fd00:976a:c305:1d::8"),
                            InetAddresses.parseNumericAddress("fd00:976a:c202:1d::7"),
                            InetAddresses.parseNumericAddress("fd00:976a:c305:1d::5")))
                    .setMtu(1500)
                    .setMtuV4(1500)
                    .setMtuV6(1500)
                    .setMtuV4(1234)
                    .setMtuV6(5678)
                    .setPduSessionId(1)
                    .setQosBearerSessions(new ArrayList<>())
                    .setTrafficDescriptors(tds)
@@ -392,6 +391,16 @@ public class DataNetworkTest extends TelephonyTest {
                InetAddresses.parseNumericAddress(IPV4_ADDRESS),
                InetAddresses.parseNumericAddress(IPV6_ADDRESS));

        assertThat(lp.getRoutes()).hasSize(2);
        assertThat(lp.getRoutes().get(0).getGateway()).isEqualTo(
                InetAddresses.parseNumericAddress("10.0.2.15"));
        assertThat(lp.getRoutes().get(0).getMtu()).isEqualTo(1234);
        assertThat(lp.getRoutes().get(1).getGateway()).isEqualTo(
                InetAddresses.parseNumericAddress("fe80::2"));
        assertThat(lp.getRoutes().get(1).getMtu()).isEqualTo(5678);
        // The higher value of v4 and v6 should be used.
        assertThat(lp.getMtu()).isEqualTo(5678);

        ArgumentCaptor<PreciseDataConnectionState> pdcsCaptor =
                ArgumentCaptor.forClass(PreciseDataConnectionState.class);
        verify(mPhone, times(2)).notifyDataConnection(pdcsCaptor.capture());