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

Commit 63915240 authored by Amit Mahajan's avatar Amit Mahajan Committed by Automerger Merge Worker
Browse files

Reset last known num uicc applications on sim reset. am: 252716d4

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

Change-Id: I58796d3d4ccc2fc9545f00d6359f88d06573c16e
parents 77c4e051 252716d4
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();
    }
}