Merge "eSIM deprecated API test Refactoring" am: a4f936408c
am: 688f9d61cd
am: 3387491083
Original change: https://android-review.googlesource.com/c/platform/packages/apps/Settings/+/1936017 Change-Id: I95bbd270044702f0ed61b8f3cb0af03d6924ad4e
This commit is contained in:
@@ -55,6 +55,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;
|
||||
@@ -74,6 +75,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;
|
||||
@@ -414,17 +416,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);
|
||||
|
||||
@@ -453,17 +472,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);
|
||||
|
||||
@@ -493,17 +526,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);
|
||||
|
||||
@@ -536,17 +586,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);
|
||||
|
||||
@@ -577,9 +643,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);
|
||||
|
||||
@@ -607,9 +681,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);
|
||||
|
||||
@@ -639,9 +722,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);
|
||||
|
||||
@@ -671,9 +763,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);
|
||||
|
||||
|
Reference in New Issue
Block a user