Merge "[Settings] IMEI should be enabled regardless existance of SIM"

This commit is contained in:
Bonian Chen
2023-02-15 12:22:15 +00:00
committed by Android (Google) Code Review
2 changed files with 15 additions and 3 deletions

View File

@@ -20,6 +20,7 @@ import static android.telephony.TelephonyManager.PHONE_TYPE_CDMA;
import static android.telephony.TelephonyManager.PHONE_TYPE_GSM;
import static android.telephony.TelephonyManager.PHONE_TYPE_NONE;
import static com.android.settings.core.BasePreferenceController.AVAILABLE;
import static com.google.common.truth.Truth.assertThat;
import static org.mockito.Mockito.anyInt;
import static org.mockito.Mockito.doReturn;
import static org.mockito.Mockito.mock;
@@ -117,6 +118,16 @@ public class ImeiInfoPreferenceControllerTest {
"imei_info2", mSecondSimPreference, phoneType2);
}
@Test
public void updatePreference_simSlotWithoutSim_shouldBeEnabled() {
mSecondController = createPreferenceController(null,
"imei_info2", mSecondSimPreference, PHONE_TYPE_NONE);
mSecondController.updatePreference(mSecondSimPreference, -1);
assertThat(mSecondSimPreference.isEnabled()).isTrue();
}
@Ignore
@Test
public void displayPreference_multiSimGsm_shouldAddSecondPreference() {