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

Commit 6b2a2f59 authored by Jack Yu's avatar Jack Yu
Browse files

Unthrottle everything when APN list changes

We should unthrottle data setup when users manually
edit the APN, or when SIM swapped.

Fix: 193486828
Test: atest DcTrackerTest
Change-Id: I100d6066ede463a8d88f750364c1350a5eb4d97c
parent be447bc8
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -2316,6 +2316,7 @@ public class DcTracker extends Handler {
        // TODO: It'd be nice to only do this if the changed entrie(s)
        // match the current operator.
        if (DBG) log("onApnChanged: createAllApnList and cleanUpAllConnections");
        mDataThrottler.reset();
        setDefaultPreferredApnIfNeeded();
        createAllApnList();
        setDataProfilesAsNeeded();
+14 −0
Original line number Diff line number Diff line
@@ -2896,6 +2896,20 @@ public class DcTrackerTest extends TelephonyTest {
                eq(DcTracker.REQUEST_TYPE_NORMAL));
    }

    @Test
    public void testDataUnthrottledAfterAPNChanged() throws Exception {
        initApns(ApnSetting.TYPE_IMS_STRING, new String[]{ApnSetting.TYPE_IMS_STRING});
        replaceInstance(DcTracker.class, "mDataThrottler", mDct, mDataThrottler);

        mDct.enableApn(ApnSetting.TYPE_IMS, DcTracker.REQUEST_TYPE_NORMAL, null);
        sendInitializationEvents();
        mDct.sendMessage(mDct.obtainMessage(DctConstants.EVENT_APN_CHANGED, null));
        waitForLastHandlerAction(mDcTrackerTestHandler.getThreadHandler());

        // Verify unthrottling
        verify(mDataThrottler).reset();
    }

    @Test
    public void testHandlingSecondHandoverRequest() throws Exception {
        initApns(ApnSetting.TYPE_IMS_STRING, new String[]{ApnSetting.TYPE_IMS_STRING});