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

Commit f217d957 authored by Hunsuk Choi's avatar Hunsuk Choi Committed by Android (Google) Code Review
Browse files

Merge "Add ImsCallProfile.EXTRA_CALL_RAT_TYPE extra to DialArgs"

parents 17397e37 6a2922c9
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -1839,6 +1839,10 @@ public class GsmCdmaCallTracker extends CallTracker {
    }

    private boolean isEmcRetryCause(int causeCode) {
        if (DomainSelectionResolver.getInstance().isDomainSelectionSupported()) {
            log("isEmcRetryCause AP based domain selection ignores the cause");
            return false;
        }
        if (causeCode == CallFailCause.EMC_REDIAL_ON_IMS ||
            causeCode == CallFailCause.EMC_REDIAL_ON_VOWIFI) {
            return true;
+11 −0
Original line number Diff line number Diff line
@@ -88,6 +88,7 @@ import android.telephony.SubscriptionManager;
import android.telephony.TelephonyManager;
import android.telephony.UiccAccessRule;
import android.telephony.UssdResponse;
import android.telephony.ims.ImsCallProfile;
import android.text.TextUtils;
import android.util.Log;
import android.util.Pair;
@@ -1443,7 +1444,17 @@ public class GsmCdmaPhone extends Phone {
                    // should not reach here
                    loge("dial unexpected Ut domain selection, ignored");
                }
            } else if (domain == PhoneConstants.DOMAIN_NON_3GPP_PS) {
                if (isEmergency) {
                    useImsForEmergency = true;
                    extras.putString(ImsCallProfile.EXTRA_CALL_RAT_TYPE,
                            String.valueOf(ServiceState.RIL_RADIO_TECHNOLOGY_IWLAN));
                } else {
                    // should not reach here
                    loge("dial DOMAIN_NON_3GPP_PS should be used only for emergency calls");
                }
            }

            extras.remove(PhoneConstants.EXTRA_DIAL_DOMAIN);
        }

+9 −2
Original line number Diff line number Diff line
@@ -22,6 +22,7 @@ import static android.telephony.AccessNetworkConstants.TRANSPORT_TYPE_WWAN;
import static android.telephony.DomainSelectionService.SELECTOR_TYPE_CALLING;
import static android.telephony.NetworkRegistrationInfo.DOMAIN_PS;

import static com.android.internal.telephony.PhoneConstants.DOMAIN_NON_3GPP_PS;
import static com.android.internal.telephony.emergency.EmergencyConstants.MODE_EMERGENCY_WLAN;
import static com.android.internal.telephony.emergency.EmergencyConstants.MODE_EMERGENCY_WWAN;

@@ -94,7 +95,7 @@ public class EmergencyCallDomainSelectionConnection extends DomainSelectionConne
        }

        CompletableFuture<Integer> future = getCompletableFuture();
        if (future != null) future.complete(DOMAIN_PS);
        if (future != null) future.complete(DOMAIN_NON_3GPP_PS);
    }

    /** {@inheritDoc} */
@@ -164,7 +165,13 @@ public class EmergencyCallDomainSelectionConnection extends DomainSelectionConne
                + ", current=" + preferredTransport);
        if (preferredTransport == mPreferredTransportType) {
            CompletableFuture<Integer> future = getCompletableFuture();
            if (future != null) future.complete(DOMAIN_PS);
            if (future != null) {
                if (preferredTransport == TRANSPORT_TYPE_WLAN) {
                    future.complete(DOMAIN_NON_3GPP_PS);
                } else {
                    future.complete(DOMAIN_PS);
                }
            }
            anm.unregisterForQualifiedNetworksChanged(mHandler);
        }
    }
+5 −0
Original line number Diff line number Diff line
@@ -2119,6 +2119,11 @@ public class ImsPhoneCallTracker extends CallTracker implements ImsPullCall {
                    conn.setPulledDialogId(dialogId);
                }

                if (intentExtras.containsKey(ImsCallProfile.EXTRA_CALL_RAT_TYPE)) {
                    logi("dialInternal containing EXTRA_CALL_RAT_TYPE, "
                            +  intentExtras.getString(ImsCallProfile.EXTRA_CALL_RAT_TYPE));
                }

                // Pack the OEM-specific call extras.
                profile.mCallExtras.putBundle(ImsCallProfile.EXTRA_OEM_EXTRAS, intentExtras);

+9 −3
Original line number Diff line number Diff line
@@ -41,9 +41,7 @@ import android.testing.TestableLooper;
import androidx.test.filters.FlakyTest;

import com.android.internal.telephony.PhoneInternalInterface.DialArgs;

import java.io.PrintWriter;
import java.io.StringWriter;
import com.android.internal.telephony.domainselection.DomainSelectionResolver;

import org.junit.After;
import org.junit.Assert;
@@ -53,6 +51,9 @@ import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.ArgumentCaptor;

import java.io.PrintWriter;
import java.io.StringWriter;

@RunWith(AndroidTestingRunner.class)
@TestableLooper.RunWithLooper
public class GsmCdmaCallTrackerTest extends TelephonyTest {
@@ -66,12 +67,16 @@ public class GsmCdmaCallTrackerTest extends TelephonyTest {
    // Mocked classes
    private GsmCdmaConnection mConnection;
    private Handler mHandler;
    private DomainSelectionResolver mDomainSelectionResolver;

    @Before
    public void setUp() throws Exception {
        super.setUp(getClass().getSimpleName());
        mConnection = mock(GsmCdmaConnection.class);
        mHandler = mock(Handler.class);
        mDomainSelectionResolver = mock(DomainSelectionResolver.class);
        doReturn(false).when(mDomainSelectionResolver).isDomainSelectionSupported();
        DomainSelectionResolver.setDomainSelectionResolver(mDomainSelectionResolver);
        mSimulatedCommands.setRadioPower(true, null);
        mPhone.mCi = this.mSimulatedCommands;

@@ -86,6 +91,7 @@ public class GsmCdmaCallTrackerTest extends TelephonyTest {
    @After
    public void tearDown() throws Exception {
        mCTUT = null;
        DomainSelectionResolver.setDomainSelectionResolver(null);
        super.tearDown();
    }

Loading