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

Commit 27f3ef2b authored by Muralidhar Reddy Mule's avatar Muralidhar Reddy Mule Committed by Automerger Merge Worker
Browse files

Merge "Disabled sim is not enabled after sim hotswap" into tm-dev am: 9882dc97

parents a6f0b739 9882dc97
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -4678,9 +4678,12 @@ public class GsmCdmaPhone extends Phone {
            return;
        }

        UiccPort port = mUiccController.getUiccPort(mPhoneId);
        String iccId = (port == null) ? null : port.getIccId();
        // Due to timing issue, sometimes UiccPort is coming null, so don't use UiccPort object
        // to retrieve the iccId here. Instead, depend on the UiccSlot API.
        String iccId = slot.getIccId(slot.getPortIndexFromPhoneId(mPhoneId));
        if (iccId == null) {
            loge("reapplyUiccAppsEnablementIfNeeded iccId is null, phoneId: " + mPhoneId
                    + " portIndex: " + slot.getPortIndexFromPhoneId(mPhoneId));
            return;
        }

+3 −7
Original line number Diff line number Diff line
@@ -106,7 +106,6 @@ public class GsmCdmaPhoneTest extends TelephonyTest {
    // Mocked classes
    private Handler mTestHandler;
    private UiccSlot mUiccSlot;
    private UiccPort mUiccPort;
    private CommandsInterface mMockCi;

    //mPhoneUnderTest
@@ -1253,8 +1252,7 @@ public class GsmCdmaPhoneTest extends TelephonyTest {
        // Have IccId defined. But expected value and current value are the same. So no RIL command
        // should be sent.
        String iccId = "Fake iccId";
        doReturn(mUiccPort).when(mUiccController).getUiccPort(anyInt());
        doReturn(iccId).when(mUiccPort).getIccId();
        doReturn(iccId).when(mUiccSlot).getIccId(anyInt());
        Message.obtain(mPhoneUT, EVENT_ICC_CHANGED, null).sendToTarget();
        processAllMessages();
        verify(mSubscriptionController).getSubInfoForIccId(iccId);
@@ -1268,9 +1266,8 @@ public class GsmCdmaPhoneTest extends TelephonyTest {
        // Set SIM to be present, with a fake iccId, and notify enablement being false.
        doReturn(mUiccSlot).when(mUiccController).getUiccSlotForPhone(anyInt());
        doReturn(IccCardStatus.CardState.CARDSTATE_PRESENT).when(mUiccSlot).getCardState();
        doReturn(mUiccPort).when(mUiccController).getUiccPort(anyInt());
        String iccId = "Fake iccId";
        doReturn(iccId).when(mUiccPort).getIccId();
        doReturn(iccId).when(mUiccSlot).getIccId(anyInt());
        Message.obtain(mPhoneUT, EVENT_UICC_APPS_ENABLEMENT_STATUS_CHANGED,
                new AsyncResult(null, false, null)).sendToTarget();
        processAllMessages();
@@ -1321,9 +1318,8 @@ public class GsmCdmaPhoneTest extends TelephonyTest {
        // Set SIM to be present, with a fake iccId, and notify enablement being false.
        doReturn(mUiccSlot).when(mUiccController).getUiccSlotForPhone(anyInt());
        doReturn(IccCardStatus.CardState.CARDSTATE_PRESENT).when(mUiccSlot).getCardState();
        doReturn(mUiccPort).when(mUiccController).getUiccPort(anyInt());
        String iccId = "Fake iccId";
        doReturn(iccId).when(mUiccPort).getIccId();
        doReturn(iccId).when(mUiccSlot).getIccId(anyInt());
        Message.obtain(mPhoneUT, EVENT_UICC_APPS_ENABLEMENT_STATUS_CHANGED,
                new AsyncResult(null, false, null)).sendToTarget();
        processAllMessages();