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 Merged-In: Icd131f133e47dae0770a4da71c51de3c2a94b42b Change-Id: I9ba5dded7817116c02d70298c9c271ff6a99925b
This commit is contained in:
committed by
Bonian Chen
parent
9057a78bfa
commit
3805373f90
@@ -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;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user