[Settings] eSIM existance detection rule change

1. eSIM retrieved from SubscriptionManager#getAvailableSubscriptionInfoList()
should be considered as existed all the time.

2. When SIM are both inactive(or active), sorted the ordering based on ordering provided by telephony framework.

Bug: 195090132
Bug: 195091953
Test: local
Change-Id: I2fe43a35e5b7965bde3b579e2297e9cdd89ec228
This commit is contained in:
Bonian Chen
2021-07-30 23:47:04 +08:00
parent 2cad599ca6
commit 848d097b94
3 changed files with 9 additions and 6 deletions

View File

@@ -90,16 +90,15 @@ public class SubscriptionAnnotation {
mOrderWithinList = subInfoIndex;
mType = mSubInfo.isEmbedded() ? TYPE_ESIM : TYPE_PSIM;
mIsExisted = true;
if (mType == TYPE_ESIM) {
int cardId = mSubInfo.getCardId();
mIsExisted = eSimCardId.contains(cardId);
mIsActive = activeSimSlotIndexList.contains(mSubInfo.getSimSlotIndex());
mIsAllowToDisplay = (cardId < 0) // always allow when eSIM not in slot
|| isDisplayAllowed(context);
return;
}
mIsExisted = true;
mIsActive = (mSubInfo.getSimSlotIndex() > SubscriptionManager.INVALID_SIM_SLOT_INDEX)
&& activeSimSlotIndexList.contains(mSubInfo.getSimSlotIndex());
mIsAllowToDisplay = isDisplayAllowed(context);
@@ -161,7 +160,7 @@ public class SubscriptionAnnotation {
public String toString() {
return TAG + "{" + "subId=" + getSubscriptionId()
+ ",type=" + getType() + ",exist=" + isExisted()
+ ",type=" + getType()
+ ",active=" + isActive() + ",displayAllow=" + isDisplayAllowed()
+ "}";
}