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

Commit ce516b37 authored by Hui Wang's avatar Hui Wang Committed by Android (Google) Code Review
Browse files

Merge "Reset throttling timer when sim loaded" into sc-dev

parents 5f8529e2 e5aa0219
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -2547,6 +2547,7 @@ public class DcTracker extends Handler {
        if (mSimState == TelephonyManager.SIM_STATE_ABSENT) {
            onSimAbsent();
        } else if (mSimState == TelephonyManager.SIM_STATE_LOADED) {
            mDataThrottler.reset();
            if (mConfigReady) {
                createAllApnList();
                setDataProfilesAsNeeded();
+14 −1
Original line number Diff line number Diff line
@@ -2907,7 +2907,20 @@ public class DcTrackerTest extends TelephonyTest {
        waitForLastHandlerAction(mDcTrackerTestHandler.getThreadHandler());

        // Verify unthrottling
        verify(mDataThrottler).reset();
        verify(mDataThrottler, times(2)).reset();
    }

    @Test
    public void testDataUnthrottledOnSimStateChanged() 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();
        sendSimStateUpdated("testDataUnthrottledOnSimStateChanged");

        // Verify unthrottling
        verify(mDataThrottler, times(2)).reset();
    }

    @Test