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

Commit 7abc384e authored by Qiang Chen's avatar Qiang Chen
Browse files

Show GSM settings with CDMA phone type

Phone type may be changed to CDMA if no SIM is in this sub and will not
show GSM settings in current design, so remove sub info check for
showing GSM settings.
Show GSM settings if the current radio can support both 3GPP and 3GPP2
radio technologies at the same time.

Bug: 278178437
Test: Manaul

Change-Id: I4f8cbfcdcff8f74944e2ba9a79b0945be6dd6ebd
parent 3874c11b
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -100,8 +100,7 @@ public class ImeiInfoDialogController {

        mDialog.setText(ID_PRL_VERSION_VALUE, getCdmaPrlVersion());

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

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

        mController.populateImeiInfo();

        verify(mDialog).setText(ID_MEID_NUMBER_VALUE, MEID_NUMBER);
        verify(mDialog).setText(ID_MIN_NUMBER_VALUE, "");
        verify(mDialog).setText(ID_PRL_VERSION_VALUE, "");
        verify(mDialog).setText(eq(ID_IMEI_VALUE), any());
        verify(mDialog).setText(eq(ID_IMEI_SV_VALUE), any());
    }

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

        mController.populateImeiInfo();

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

    @Test
    public void populateImeiInfo_gsmSimDisabled_shouldSetImeiAndRemoveCdmaSettings() {
        ReflectionHelpers.setField(mController, "mSubscriptionInfo", null);