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

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

Update subId on sim state READY. am: cec0675c am: 410794dd

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

Change-Id: I930f701f06e38384243a45462fcc32e1c650dbbc
parents 1372e8cc 410794dd
Loading
Loading
Loading
Loading
+2 −7
Original line number Diff line number Diff line
@@ -419,14 +419,9 @@ public class SubscriptionInfoUpdater extends Handler {
        UiccSlot uiccSlot = UiccController.getInstance().getUiccSlotForPhone(phoneId);
        String iccId = (uiccSlot != null) ? IccUtils.stripTrailingFs(uiccSlot.getIccId()) : null;
        if (!TextUtils.isEmpty(iccId)) {
            // Call updateSubscriptionInfoByIccId() only if was
            // not done earlier from SIM Locked event
            if (sIccId[phoneId] == null) {
            sIccId[phoneId] = iccId;

            updateSubscriptionInfoByIccId(phoneId, true /* updateEmbeddedSubs */);
        }
        }

        cardIds.add(getCardIdFromPhoneId(phoneId));
        updateEmbeddedSubscriptions(cardIds, (hasChanges) -> {
+0 −1
Original line number Diff line number Diff line
@@ -1164,7 +1164,6 @@ public class UiccController extends Handler {
        }

        if (changed && resp.refreshResult == IccRefreshResponse.REFRESH_RESULT_RESET) {
            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)
+0 −8
Original line number Diff line number Diff line
@@ -528,14 +528,6 @@ 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.
     */
+0 −20
Original line number Diff line number Diff line
@@ -21,8 +21,6 @@ import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.ArgumentMatchers.nullable;
import static org.mockito.Mockito.any;
import static org.mockito.Mockito.atLeast;
import static org.mockito.Mockito.doReturn;
@@ -636,22 +634,4 @@ public class UiccControllerTest extends TelephonyTest {
        assertEquals(mUiccControllerUT.convertToPublicCardId(knownEidFromApdu),
                mUiccControllerUT.getCardIdForDefaultEuicc());
    }

    @Test
    public void testSimRefresh() {
        mUiccControllerUT.mUiccSlots[0] = mMockSlot;
        doReturn(mMockCard).when(mMockSlot).getUiccCard();
        doReturn(mMockProfile).when(mMockCard).getUiccProfile();

        doReturn(true).when(mMockCard).resetAppWithAid(nullable(String.class), eq(true));
        IccRefreshResponse resp = new IccRefreshResponse();
        resp.refreshResult = IccRefreshResponse.REFRESH_RESULT_RESET;
        AsyncResult ar = new AsyncResult(null, resp, null);
        Message msg = Message.obtain(mUiccControllerUT, EVENT_SIM_REFRESH, ar);
        mUiccControllerUT.handleMessage(msg);
        processAllMessages();

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