Remove logic to manually search inactive pSIM.

Nowe inserted inactive pSIM will be included in Telephony's get
available and get selectable subInfo list so that logic is no longer
needed.

Bug: 147128878
Test: unittest
Change-Id: Icd131f133e47dae0770a4da71c51de3c2a94b42b
This commit is contained in:
Malcolm Chen
2020-01-15 14:54:06 -08:00
parent 3225b3255d
commit 640e56433f
2 changed files with 0 additions and 61 deletions

View File

@@ -80,39 +80,10 @@ public class SubscriptionUtil {
return sAvailableResultsForTesting;
}
final SubscriptionManager subMgr = context.getSystemService(SubscriptionManager.class);
final TelephonyManager telMgr = context.getSystemService(TelephonyManager.class);
final List<SubscriptionInfo> subscriptions =
new ArrayList<>(emptyIfNull(subMgr.getSelectableSubscriptionInfoList()));
// Look for inactive but present physical SIMs that are missing from the selectable list.
final List<UiccSlotInfo> missing = new ArrayList<>();
final UiccSlotInfo[] slotsInfo = telMgr.getUiccSlotsInfo();
for (int i = 0; slotsInfo != null && i < slotsInfo.length; i++) {
final UiccSlotInfo slotInfo = slotsInfo[i];
if (isInactiveInsertedPSim(slotInfo)) {
final int index = slotInfo.getLogicalSlotIdx();
final String cardId = slotInfo.getCardId();
final boolean found = subscriptions.stream().anyMatch(info ->
index == info.getSimSlotIndex() && cardId.equals(info.getCardString()));
if (!found) {
missing.add(slotInfo);
}
}
}
if (missing.isEmpty()) {
return subscriptions;
}
for (SubscriptionInfo info : subMgr.getAllSubscriptionInfoList()) {
for (UiccSlotInfo slotInfo : missing) {
if (info.getSimSlotIndex() == slotInfo.getLogicalSlotIdx()
&& info.getCardString().equals(slotInfo.getCardId())) {
subscriptions.add(info);
break;
}
}
}
return subscriptions;
}