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

Commit 53392a23 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: 63915240

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

Change-Id: I63d2b0fa4f38a8ecdf9e93ef0e4c0a745925bda4
parents 42914b0a 63915240
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();
    }
}