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

Commit 7ddbc25e authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Unthrottle everything when APN list changes" into sc-dev

parents f5c599c1 6b2a2f59
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});