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

Commit 65afa780 authored by Hui Wang's avatar Hui Wang Committed by Automerger Merge Worker
Browse files

Merge "Reset throttling timer when sim loaded" into sc-dev am: ce516b37 am: f53e47f6

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

Change-Id: Ic4ba2fed5cb5cd193e6fa1ee158f89bc6ba60f93
parents 76b5e964 f53e47f6
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