Remove oneSelectableTwoDisabledPSimsOneAbsent_twoResults

It's not needed as logic of detecting disabled pSIM is moved to
Telephony.

Bug: 147791865
Test: sanity
Change-Id: I158243bcf59e6c39fb55421632e7013ebc80ae80
This commit is contained in:
Malcolm Chen
2020-02-04 19:09:52 -08:00
committed by Xiangyu/Malcolm Chen
parent 626581e339
commit dc1dd56b41

View File

@@ -16,9 +16,6 @@
package com.android.settings.network;
import static android.telephony.UiccSlotInfo.CARD_STATE_INFO_ABSENT;
import static android.telephony.UiccSlotInfo.CARD_STATE_INFO_PRESENT;
import static com.google.common.truth.Truth.assertThat;
import static org.mockito.Mockito.doReturn;
@@ -29,10 +26,8 @@ import android.content.Context;
import android.telephony.SubscriptionInfo;
import android.telephony.SubscriptionManager;
import android.telephony.TelephonyManager;
import android.telephony.UiccSlotInfo;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock;
@@ -87,43 +82,6 @@ public class SubscriptionUtilTest {
assertThat(subs).hasSize(2);
}
@Test
@Ignore
public void getAvailableSubscriptions_oneSelectableTwoDisabledPSimsOneAbsent_twoResults() {
final SubscriptionInfo info1 = mock(SubscriptionInfo.class);
final SubscriptionInfo info2 = mock(SubscriptionInfo.class);
final SubscriptionInfo info3 = mock(SubscriptionInfo.class);
when(info1.getSubscriptionId()).thenReturn(111);
when(info1.getSimSlotIndex()).thenReturn(-1);
when(info2.getSubscriptionId()).thenReturn(222);
when(info2.getSimSlotIndex()).thenReturn(-1);
when(info3.getSubscriptionId()).thenReturn(333);
when(info3.getSimSlotIndex()).thenReturn(0);
when(mSubMgr.getAvailableSubscriptionInfoList()).thenReturn(Arrays.asList(info1));
when(mSubMgr.getAllSubscriptionInfoList()).thenReturn(Arrays.asList(info1, info2, info3));
final UiccSlotInfo info2slot = mock(UiccSlotInfo.class);
final UiccSlotInfo info3slot = mock(UiccSlotInfo.class);
when(info2slot.getLogicalSlotIdx()).thenReturn(-1);
when(info2slot.getCardStateInfo()).thenReturn(CARD_STATE_INFO_ABSENT);
when(info3slot.getLogicalSlotIdx()).thenReturn(0);
when(info3slot.getCardStateInfo()).thenReturn(CARD_STATE_INFO_PRESENT);
final UiccSlotInfo[] slotInfos = {info2slot, info3slot};
when(mTelMgr.getUiccSlotsInfo()).thenReturn(slotInfos);
final List<SubscriptionInfo> subs = SubscriptionUtil.getAvailableSubscriptions(mContext);
assertThat(subs).hasSize(2);
assertThat(subs.get(0).getSubscriptionId()).isEqualTo(111);
assertThat(subs.get(1).getSubscriptionId()).isEqualTo(333);
}
@Test
public void getActiveSubscriptions_nullInfoFromSubscriptionManager_nonNullResult() {
when(mSubMgr.getActiveSubscriptionInfoList()).thenReturn(null);