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

Commit 9b0d5955 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Consider MMS as mutable cap" into main

parents 1957b211 20584377
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -460,7 +460,10 @@ public class DataNetwork extends StateMachine {
            // Dynamically add and remove MMTEL capability when network transition between VoPS
            // and non-VoPS network if the request is not MMTEL. For MMTEL, we retain the capability
            // to prevent immediate tear down.
            NetworkCapabilities.NET_CAPABILITY_MMTEL
            NetworkCapabilities.NET_CAPABILITY_MMTEL,
            // Dynamically add and remove MMS capability depending on QNS's preference if there is
            // a transport specific APN alternative.
            NetworkCapabilities.NET_CAPABILITY_MMS
    );

    /** The parent state. Any messages not handled by the child state fallback to this. */
+8 −2
Original line number Diff line number Diff line
@@ -2421,6 +2421,10 @@ public class DataNetworkTest extends TelephonyTest {
        doReturn(true).when(mFeatureFlags).forceIwlanMms();
        setupDataNetwork();

        TelephonyNetworkAgent mockNetworkAgent = Mockito.mock(TelephonyNetworkAgent.class);
        replaceInstance(DataNetwork.class, "mNetworkAgent",
                mDataNetworkUT, mockNetworkAgent);

        assertThat(mDataNetworkUT.getNetworkCapabilities()
                .hasCapability(NetworkCapabilities.NET_CAPABILITY_MMS)).isTrue();

@@ -2465,11 +2469,13 @@ public class DataNetworkTest extends TelephonyTest {
                .onPreferredTransportChanged(NetworkCapabilities.NET_CAPABILITY_MMS, false);
        processAllMessages();

        // Check if MMS capability is removed.
        // Check if MMS capability is removed, and we don't recreat network agent which triggers
        // powering comsuming internet validation.
        assertThat(mDataNetworkUT.getNetworkCapabilities()
                .hasCapability(NetworkCapabilities.NET_CAPABILITY_MMS)).isFalse();
        verify(mockNetworkAgent, never()).abandon();

        // Now QNS prefers MMS on IWLAN
        // Now QNS prefers MMS on WWAN
        doReturn(AccessNetworkConstants.TRANSPORT_TYPE_WWAN).when(mAccessNetworksManager)
            .getPreferredTransportByNetworkCapability(NetworkCapabilities.NET_CAPABILITY_MMS);
        accessNetworksManagerCallbackArgumentCaptor.getValue()