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

Commit 6c830861 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 am: 9c97f570

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

Change-Id: I5d0bb9d68819c59a70d39b0614f1bde75dd13df5
parents 5a1770f0 9c97f570
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1164,7 +1164,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
@@ -528,10 +528,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();
    }
}