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

Commit 46837417 authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "Call set initial attach apn when roaming status changes"

parents 64497e8b f153a7fd
Loading
Loading
Loading
Loading
+10 −6
Original line number Diff line number Diff line
@@ -2749,9 +2749,11 @@ public class DcTracker extends Handler {
    private void onRoamingOff() {
        if (DBG) log("onRoamingOff");

        // TODO: Remove this once all old vendor RILs are gone. We don't need to send the
        // data profile again as the modem should have both roaming and non-roaming protocol in
        // place. Modem should choose the right protocol based on roaming condition.
        // TODO: Remove this once all old vendor RILs are gone. We don't need to set initial apn
        // attach and send the data profile again as the modem should have both roaming and
        // non-roaming protocol in place. Modem should choose the right protocol based on the
        // roaming condition.
        setInitialAttachApn();
        setDataProfilesAsNeeded();

        if (!mDataEnabledSettings.isUserDataEnabled()) return;
@@ -2767,9 +2769,11 @@ public class DcTracker extends Handler {
    private void onRoamingOn() {
        if (DBG) log("onRoamingOn");

        // TODO: Remove this once all old vendor RILs are gone. We don't need to send the
        // data profile again as the modem should have both roaming and non-roaming protocol in
        // place. Modem should choose the right protocol based on roaming condition.
        // TODO: Remove this once all old vendor RILs are gone. We don't need to set initial apn
        // attach and send the data profile again as the modem should have both roaming and
        // non-roaming protocol in place. Modem should choose the right protocol based on the
        // roaming condition.
        setInitialAttachApn();
        setDataProfilesAsNeeded();

        if (!mDataEnabledSettings.isUserDataEnabled()) {
+4 −5
Original line number Diff line number Diff line
@@ -28,6 +28,7 @@ import static org.mockito.Matchers.anyInt;
import static org.mockito.Matchers.anyLong;
import static org.mockito.Matchers.anyString;
import static org.mockito.Matchers.eq;
import static org.mockito.Matchers.nullable;
import static org.mockito.Mockito.doAnswer;
import static org.mockito.Mockito.doReturn;
import static org.mockito.Mockito.never;
@@ -704,6 +705,9 @@ public class DcTrackerTest extends TelephonyTest {
        mDct.setDataEnabled(true);

        waitForMs(200);
        verify(mSimulatedCommandsVerifier, times(1)).setInitialAttachApn(any(DataProfile.class),
                eq(true), nullable(Message.class));

        ArgumentCaptor<DataProfile> dpCaptor = ArgumentCaptor.forClass(DataProfile.class);
        verify(mSimulatedCommandsVerifier, times(1)).setupDataCall(
                eq(ServiceState.RIL_RADIO_TECHNOLOGY_UMTS), dpCaptor.capture(),
@@ -713,11 +717,6 @@ public class DcTrackerTest extends TelephonyTest {
        assertEquals(DctConstants.State.CONNECTED, mDct.getOverallState());
        assertEquals(DctConstants.State.IDLE, mDct.getState(PhoneConstants.APN_TYPE_DEFAULT));
        assertEquals(DctConstants.State.CONNECTED, mDct.getState(PhoneConstants.APN_TYPE_IMS));

        // reset roaming settings / data enabled settings at end of this test
        mDct.setDataOnRoamingEnabled(roamingEnabled);
        mDct.setDataEnabled(dataEnabled);
        waitForMs(200);
    }

    // Test the default data switch scenario.