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

Commit 1bebc7bc authored by Jack Yu's avatar Jack Yu Committed by android-build-merger
Browse files

Merge "Call set initial attach apn when roaming status changes" am: 46837417

am: 4046c629

Change-Id: I2b5f5ca4dcb5ce68e1ed51e76008666ac83d61ae
parents 51fb4c2b 4046c629
Loading
Loading
Loading
Loading
+10 −6
Original line number Diff line number Diff line
@@ -2786,9 +2786,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;
@@ -2804,9 +2806,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.