eSIM deprecated API test Refactoring

Test: build
Bug: 159354974
Change-Id: Iedeb90f186ab9f82894e2fecef86d339c8989542
Merged-In: Iedeb90f186ab9f82894e2fecef86d339c8989542
This commit is contained in:
sandeepjs
2021-09-30 09:09:59 +00:00
committed by Sandeep Jawalkar
parent 213d7de48c
commit dbe31b8e6b
8 changed files with 165 additions and 55 deletions

View File

@@ -54,6 +54,7 @@ import android.telephony.SubscriptionInfo;
import android.telephony.SubscriptionManager;
import android.telephony.TelephonyManager;
import android.telephony.UiccCardInfo;
import android.telephony.UiccPortInfo;
import android.telephony.euicc.EuiccManager;
import androidx.lifecycle.LifecycleOwner;
@@ -73,6 +74,7 @@ import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@@ -387,17 +389,34 @@ public class SimStatusDialogControllerTest {
false, // isEuicc
0, // cardId
null, // eid
"123451234567890", // iccid
0, // slotIndex
true); // isRemovable
true, // isRemovable
false, // isMultipleEnabledProfileSupported
Collections.singletonList(
new UiccPortInfo(
"123451234567890", // iccId
0, // portIdx
0, // logicalSlotIdx
true // isActive
)
));
uiccCardInfos.add(uiccCardInfo1);
UiccCardInfo uiccCardInfo2 = new UiccCardInfo(
true, // isEuicc
1, // cardId
null, // eid (unavailable)
null, // iccid
1, // slotIndex
false); // isRemovable
false, // isRemovable
false,
Collections.singletonList(
new UiccPortInfo(
null, // iccId
1, // portIdx
1, // logicalSlotIdx
true // isActive
)
)
);
uiccCardInfos.add(uiccCardInfo2);
when(mTelephonyManager.getUiccCardsInfo()).thenReturn(uiccCardInfos);
@@ -427,17 +446,31 @@ public class SimStatusDialogControllerTest {
true, // isEuicc
0, // cardId
TEST_EID_FROM_CARD, // eid
null, // iccid
0, // slotIndex
false); // isRemovable
false, // isRemovable
false,
Collections.singletonList(new UiccPortInfo(
null, // iccId
0, // portIdx
0, // logicalSlotIdx
true // isActive
)));
uiccCardInfos.add(uiccCardInfo1);
UiccCardInfo uiccCardInfo2 = new UiccCardInfo(
false, // isEuicc
1, // cardId
null, // eid
"123451234567890", // iccid
1, // slotIndex
true); // isRemovable
true, // isRemovable
false, // isMultipleEnabledProfileSupported
Collections.singletonList(
new UiccPortInfo(
"123451234567890", // iccId
1, // portIdx
1, // logicalSlotIdx
true // isActive
)
));
uiccCardInfos.add(uiccCardInfo2);
when(mTelephonyManager.getUiccCardsInfo()).thenReturn(uiccCardInfos);
@@ -468,17 +501,34 @@ public class SimStatusDialogControllerTest {
false, // isEuicc
0, // cardId
null, // eid
"123451234567890", // iccid
0, // slotIndex
true); // isRemovable
true, // isRemovable
false, // isMultipleEnabledProfileSupported
Collections.singletonList(
new UiccPortInfo(
"123451234567890", // iccId
1, // portIdx
1, // logicalSlotIdx
true // isActive
)
));
uiccCardInfos.add(uiccCardInfo1);
UiccCardInfo uiccCardInfo2 = new UiccCardInfo(
true, // isEuicc
1, // cardId
null, // eid (unavailable)
null, // iccid
1, // slotIndex
false); // isRemovable
false, // isRemovable
false, // isMultipleEnabledProfileSupported
Collections.singletonList(
new UiccPortInfo(
null, // iccId
1, // portIdx
1, // logicalSlotIdx
true // isActive
)
)
);
uiccCardInfos.add(uiccCardInfo2);
when(mTelephonyManager.getUiccCardsInfo()).thenReturn(uiccCardInfos);
@@ -511,17 +561,33 @@ public class SimStatusDialogControllerTest {
false, // isEuicc
0, // cardId
null, // eid
"123451234567890", // iccid
0, // slotIndex
true); // isRemovable
true, // isRemovable
false, // isMultipleEnabledProfileSupported
Collections.singletonList(
new UiccPortInfo(
"123451234567890", // iccId
0, // portIdx
0, // logicalSlotIdx
true // isActive
)
));
uiccCardInfos.add(uiccCardInfo1);
UiccCardInfo uiccCardInfo2 = new UiccCardInfo(
true, // isEuicc
1, // cardId
TEST_EID_FROM_CARD, // eid
null, // iccid
1, // slotIndex
false); // isRemovable
false, // isRemovable
false, // isMultipleEnabledProfileSupported
Collections.singletonList(
new UiccPortInfo(
null, // iccId
1, // portIdx
1, // logicalSlotIdx
true // isActive
)
));
uiccCardInfos.add(uiccCardInfo2);
when(mTelephonyManager.getUiccCardsInfo()).thenReturn(uiccCardInfos);
@@ -552,9 +618,17 @@ public class SimStatusDialogControllerTest {
true, // isEuicc
0, // cardId
TEST_EID_FROM_CARD, // eid (not used)
null, // iccid
0, // slotIndex
false); // isRemovable
false, // isRemovable
false, // isMultipleEnabledProfileSupported
Collections.singletonList(
new UiccPortInfo(
null, // iccId
0, // portIdx
0, // logicalSlotIdx
true // isActive
)
));
uiccCardInfos.add(uiccCardInfo);
when(mTelephonyManager.getUiccCardsInfo()).thenReturn(uiccCardInfos);
@@ -583,9 +657,18 @@ public class SimStatusDialogControllerTest {
true, // isEuicc (eUICC slot is selected)
0, // cardId
TEST_EID_FROM_CARD, // eid (not used)
null, // iccid
0, // slotIndex
false); // isRemovable
false, // isRemovable
false, // isMultipleEnabledProfileSupported
Collections.singletonList(
new UiccPortInfo(
null, // iccId
0, // portIdx
0, // logicalSlotIdx
true // isActive
)
)
);
uiccCardInfos.add(uiccCardInfo);
when(mTelephonyManager.getUiccCardsInfo()).thenReturn(uiccCardInfos);
@@ -616,9 +699,18 @@ public class SimStatusDialogControllerTest {
false, // isEuicc (eUICC slot is not selected)
0, // cardId
null, // eid
"123451234567890", // iccid
0, // slotIndex
true); // isRemovable
true, // isRemovable
false, // isMultipleEnabledProfileSupported
Collections.singletonList(
new UiccPortInfo(
"123451234567890", // iccId
0, // portIdx
0, // logicalSlotIdx
true // isActive
)
));
uiccCardInfos.add(uiccCardInfo);
when(mTelephonyManager.getUiccCardsInfo()).thenReturn(uiccCardInfos);
@@ -649,9 +741,17 @@ public class SimStatusDialogControllerTest {
false, // isEuicc
0, // cardId
null, // eid
"123451234567890", // iccid
0, // slotIndex
true); // isRemovable
true, // isRemovable
false, //isMultipleEnabledProfileSupported
Collections.singletonList(
new UiccPortInfo(
"123451234567890", // iccId
0, // portIdx
0, // logicalSlotIdx
true // isActive
)
));
uiccCardInfos.add(uiccCardInfo);
when(mTelephonyManager.getUiccCardsInfo()).thenReturn(uiccCardInfos);