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

Commit 4abf4ac9 authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Merge cherrypicks of ['googleplex-android-review.googlesource.com/28141635'] into 24Q3-release.

Change-Id: I48b78dc0e3ab488221148c04178be9a7e5ec4fe4
parents 5b81bc38 d1579260
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -1502,6 +1502,14 @@ public class DataConfigManager extends Handler {
                .collect(Collectors.toSet());
    }

    /**
     * {@code True} enables mms to be attempted on iwlan if possible, even if existing cellular
     *  networks already supports iwlan.
     */
    public boolean isForceIwlanMmsFeatureEnabled() {
        return mResources.getBoolean(com.android.internal.R.bool.force_iwlan_mms_feature_enabled);
    }

    /**
     * Log debug messages.
     * @param s debug messages
+5 −3
Original line number Diff line number Diff line
@@ -1263,7 +1263,7 @@ public class DataNetwork extends StateMachine {
                        getHandler(), EVENT_VOICE_CALL_ENDED, null);
            }

            if (mFlags.forceIwlanMms()) {
            if (mFlags.forceIwlanMms() && mDataConfigManager.isForceIwlanMmsFeatureEnabled()) {
                if (mDataProfile.canSatisfy(NetworkCapabilities.NET_CAPABILITY_MMS)) {
                    mAccessNetworksManagerCallback = new AccessNetworksManagerCallback(
                            getHandler()::post) {
@@ -1289,7 +1289,8 @@ public class DataNetwork extends StateMachine {
        @Override
        public void exit() {
            logv("Unregistering all events.");
            if (mFlags.forceIwlanMms() && mAccessNetworksManagerCallback != null) {
            if (mFlags.forceIwlanMms() && mAccessNetworksManagerCallback != null
                    && mDataConfigManager.isForceIwlanMmsFeatureEnabled()) {
                mAccessNetworksManager.unregisterCallback(mAccessNetworksManagerCallback);
            }

@@ -2488,7 +2489,8 @@ public class DataNetwork extends StateMachine {
        // will be attempted on IWLAN if possible, even if existing cellular networks already
        // supports IWLAN.
        if (mFlags.forceIwlanMms() && builder.build()
                .hasCapability(NetworkCapabilities.NET_CAPABILITY_MMS)) {
                .hasCapability(NetworkCapabilities.NET_CAPABILITY_MMS)
                && mDataConfigManager.isForceIwlanMmsFeatureEnabled()) {
            // If QNS sets MMS preferred on IWLAN, and it is possible to setup an MMS network on
            // IWLAN, then we need to remove the MMS capability on the cellular network. This will
            // allow the new MMS network to be brought up on IWLAN when MMS network request arrives.
+1 −0
Original line number Diff line number Diff line
@@ -2419,6 +2419,7 @@ public class DataNetworkTest extends TelephonyTest {
    @Test
    public void testMmsCapabilityRemovedWhenMmsPreferredOnIwlan() throws Exception {
        doReturn(true).when(mFeatureFlags).forceIwlanMms();
        doReturn(true).when(mDataConfigManager).isForceIwlanMmsFeatureEnabled();
        setupDataNetwork();

        assertThat(mDataNetworkUT.getNetworkCapabilities()