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

Commit 4d6e1d1c authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Unthrottle everything when APN list changes" into sc-dev am: 7ddbc25e

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/opt/telephony/+/15349572

Change-Id: I92a4f278cf5ec03a304cd61093f04f0798812987
parents 213d63a5 7ddbc25e
Loading
Loading
Loading
Loading
+1 −0
Original line number Original line 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)
        // TODO: It'd be nice to only do this if the changed entrie(s)
        // match the current operator.
        // match the current operator.
        if (DBG) log("onApnChanged: createAllApnList and cleanUpAllConnections");
        if (DBG) log("onApnChanged: createAllApnList and cleanUpAllConnections");
        mDataThrottler.reset();
        setDefaultPreferredApnIfNeeded();
        setDefaultPreferredApnIfNeeded();
        createAllApnList();
        createAllApnList();
        setDataProfilesAsNeeded();
        setDataProfilesAsNeeded();
+14 −0
Original line number Original line Diff line number Diff line
@@ -2896,6 +2896,20 @@ public class DcTrackerTest extends TelephonyTest {
                eq(DcTracker.REQUEST_TYPE_NORMAL));
                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
    @Test
    public void testHandlingSecondHandoverRequest() throws Exception {
    public void testHandlingSecondHandoverRequest() throws Exception {
        initApns(ApnSetting.TYPE_IMS_STRING, new String[]{ApnSetting.TYPE_IMS_STRING});
        initApns(ApnSetting.TYPE_IMS_STRING, new String[]{ApnSetting.TYPE_IMS_STRING});