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

Commit c8badc7c authored by jeffreyhuang's avatar jeffreyhuang
Browse files

Display IMEI info when sim is removed

Change-Id: I9c6db4481e9b03c8984d350cd54722a3667b6c49
Fixes: 70165342
Test: make RunSettingsRoboTests -j40
parent 7ec34c17
Loading
Loading
Loading
Loading
+3 −5
Original line number Diff line number Diff line
@@ -80,9 +80,6 @@ public class ImeiInfoDialogController {
     * Sets IMEI/MEID information based on whether the device is CDMA or GSM.
     */
    public void populateImeiInfo() {
        if (mSubscriptionInfo == null) {
            return;
        }
        if (mTelephonyManager.getPhoneType() == TelephonyManager.PHONE_TYPE_CDMA) {
            updateDialogForCdmaPhone();
        } else {
@@ -94,7 +91,8 @@ public class ImeiInfoDialogController {
        final Resources res = mDialog.getContext().getResources();
        mDialog.setText(ID_MEID_NUMBER_VALUE, getMeid());
        mDialog.setText(ID_MIN_NUMBER_VALUE,
                mTelephonyManager.getCdmaMin(mSubscriptionInfo.getSubscriptionId()));
                mSubscriptionInfo != null ? mTelephonyManager.getCdmaMin(
                        mSubscriptionInfo.getSubscriptionId()) : "");

        if (res.getBoolean(R.bool.config_msid_enable)) {
            mDialog.setText(ID_MIN_NUMBER_LABEL,
@@ -103,7 +101,7 @@ public class ImeiInfoDialogController {

        mDialog.setText(ID_PRL_VERSION_VALUE, getCdmaPrlVersion());

        if (isCdmaLteEnabled()) {
        if (mSubscriptionInfo != null && isCdmaLteEnabled()) {
            // Show IMEI for LTE device
            mDialog.setText(ID_IMEI_VALUE,
                    getTextAsDigits(mTelephonyManager.getImei(mSlotId)));
+11 −0
Original line number Diff line number Diff line
@@ -111,6 +111,17 @@ public class ImeiInfoDialogControllerTest {
        verify(mDialog).removeViewFromScreen(ID_GSM_SETTINGS);
    }

    @Test
    public void populateImeiInfo_cdmaSimDisabled_shouldRemoveImeiInfoAndSetMinToEmpty() {
        ReflectionHelpers.setField(mController, "mSubscriptionInfo", null);
        when(mTelephonyManager.getPhoneType()).thenReturn(TelephonyManager.PHONE_TYPE_CDMA);

        mController.populateImeiInfo();

        verify(mDialog).setText(ID_MIN_NUMBER_VALUE, "");
        verify(mDialog).removeViewFromScreen(ID_GSM_SETTINGS);
    }

    @Test
    public void populateImeinfo_gsm_shouldSetImeiAndRemoveCdmaSettings() {
        when(mTelephonyManager.getPhoneType()).thenReturn(TelephonyManager.PHONE_TYPE_GSM);