Add CTS test parts about SubscriptionManager#getActiveSubscriptionIdList
Bug: 155119260
Fix: 155119260
Test: Local
Change-Id: Id528a46ace802f42b9996129aa5ddb0a2504e2c9
diff --git a/tests/tests/telephony/current/src/android/telephony/cts/SubscriptionManagerTest.java b/tests/tests/telephony/current/src/android/telephony/cts/SubscriptionManagerTest.java
index efcc408..c7b14ec 100644
--- a/tests/tests/telephony/current/src/android/telephony/cts/SubscriptionManagerTest.java
+++ b/tests/tests/telephony/current/src/android/telephony/cts/SubscriptionManagerTest.java
@@ -25,6 +25,7 @@
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
@@ -211,12 +212,16 @@
if (!isSupported()) return;
List<SubscriptionInfo> subList = mSm.getActiveSubscriptionInfoList();
+ int[] idList = mSm.getActiveSubscriptionIdList();
// Assert when there is no sim card present or detected
assertNotNull("Active subscriber required", subList);
+ assertNotNull("Active subscriber required", idList);
assertFalse("Active subscriber required", subList.isEmpty());
+ assertNotEquals("Active subscriber required", 0, idList.length);
for (int i = 0; i < subList.size(); i++) {
assertTrue(subList.get(i).getSubscriptionId() >= 0);
assertTrue(subList.get(i).getSimSlotIndex() >= 0);
+ assertTrue(ArrayUtils.contains(idList, subList.get(i).getSubscriptionId()));
if (i >= 1) {
assertTrue(subList.get(i - 1).getSimSlotIndex()
<= subList.get(i).getSimSlotIndex());