From 850817b63dce20f1ec8a8b40351be77b468cd2a2 Mon Sep 17 00:00:00 2001 From: Takumi Hori Date: Thu, 28 Jun 2018 16:48:52 +0900 Subject: Sort activeSubscriptionInfoList according to API annotation SubscriptionManager#getActiveSubscriptionInfoList() should return sorted list by sim slot index then by subscription id, according to API annotation in JavaDoc. Issue: After SIM swap on DSDS device, tabName of slot1 becomes "UNKNOWN" in MobileNetworkSettings. When updating tabName, slotId is compared with activeSubscriptionInfo list one by one in ASCENDING order. But sometimes activeSubscriptionInfoList is NOT sorted. In this case, slotId will be unmatched and tabName becomes "UNKNOWN". Test: manual - Check that display name of subscription is shown correctly in the tab of mobile network settings. Bug: 111185160 Change-Id: I67ad0578c1202701dbbca6505458cf529f59570b --- src/java/com/android/internal/telephony/SubscriptionController.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/java/com/android/internal/telephony/SubscriptionController.java b/src/java/com/android/internal/telephony/SubscriptionController.java index 4ff63b70d..59372fb70 100644 --- a/src/java/com/android/internal/telephony/SubscriptionController.java +++ b/src/java/com/android/internal/telephony/SubscriptionController.java @@ -652,6 +652,7 @@ public class SubscriptionController extends ISub.Stub { List activeSubscriptionInfoList = getSubInfo( SubscriptionManager.SIM_SLOT_INDEX + ">=0", null); if (activeSubscriptionInfoList != null) { + activeSubscriptionInfoList.sort(SUBSCRIPTION_INFO_COMPARATOR); mCacheActiveSubInfoList.addAll(activeSubscriptionInfoList); } if (DBG_CACHE) { -- cgit v1.2.3