From 01f43ff2909790cbb72ac6aee0952420204e9dc8 Mon Sep 17 00:00:00 2001 From: tom hsu Date: Sat, 24 Jul 2021 06:12:30 +0800 Subject: [PATCH] [Settings] Fix problem that MobileNetworkActivity show wrong Info. - UiccSlotInfo only provide current active slots. It doesn't provide inactive slot. Thus,it should not use it for checking sim existed. Bug: 194022251 Bug: 194378040 Test: Maunal test Change-Id: I00a3fcf3f700bee804bad12039d6d13a1404cc74 --- .../settings/network/helper/SubscriptionAnnotation.java | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/com/android/settings/network/helper/SubscriptionAnnotation.java b/src/com/android/settings/network/helper/SubscriptionAnnotation.java index fae5b9bbb4b..f6d3ccd53ee 100644 --- a/src/com/android/settings/network/helper/SubscriptionAnnotation.java +++ b/src/com/android/settings/network/helper/SubscriptionAnnotation.java @@ -100,11 +100,10 @@ public class SubscriptionAnnotation { return; } - mIsExisted = simSlotIndex.contains(mSubInfo.getSimSlotIndex()); - mIsActive = activeSimSlotIndexList.contains(mSubInfo.getSimSlotIndex()); - if (mIsExisted) { - mIsAllowToDisplay = isDisplayAllowed(context); - } + mIsExisted = true; + mIsActive = (mSubInfo.getSimSlotIndex() > SubscriptionManager.INVALID_SIM_SLOT_INDEX) + && activeSimSlotIndexList.contains(mSubInfo.getSimSlotIndex()); + mIsAllowToDisplay = isDisplayAllowed(context); } // the index provided during construction of Builder