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

Commit 252716d4 authored by Amit Mahajan's avatar Amit Mahajan
Browse files

Reset last known num uicc applications on sim reset.

Test: atest UiccController
Test: verified in lab against failing test
Bug: 194749659
Change-Id: Ib19d378fe6b0b83683d38b91f4aa556bda6f6ed0
parent 5ace0b1e
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1163,7 +1163,7 @@ public class UiccController extends Handler {
        }

        if (changed && resp.refreshResult == IccRefreshResponse.REFRESH_RESULT_RESET) {
            uiccCard.getUiccProfile().updateIccAvailability(true);
            uiccCard.getUiccProfile().onSimReset();
            // If there is any change on RESET, reset carrier config as well. From carrier config
            // perspective, this is treated the same as sim state unknown
            CarrierConfigManager configManager = (CarrierConfigManager)
+9 −1
Original line number Diff line number Diff line
@@ -523,10 +523,18 @@ public class UiccProfile extends IccCard {
        }
    }

    /**
     * This function is called on SIM_REFRESH of type RESET
     */
    public void onSimReset() {
        mLastReportedNumOfUiccApplications = 0;
        updateIccAvailability(true);
    }

    /**
     * ICC availability/state changed. Update corresponding fields and external state if needed.
     */
    public void updateIccAvailability(boolean allAppsChanged) {
    private void updateIccAvailability(boolean allAppsChanged) {
        synchronized (mLock) {
            UiccCardApplication newApp;
            IccRecords newRecords = null;
+2 −2
Original line number Diff line number Diff line
@@ -651,7 +651,7 @@ public class UiccControllerTest extends TelephonyTest {
        mUiccControllerUT.handleMessage(msg);
        processAllMessages();

        // verify that updateIccAvailability() is called on refresh with RESET
        verify(mMockProfile).updateIccAvailability(true);
        // verify that onSimReset() is called on refresh with RESET
        verify(mMockProfile).onSimReset();
    }
}