aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTakumi Hori <takumi.x.hori@sony.com>2018-06-28 16:48:52 +0900
committerWang Han <416810799@qq.com>2019-08-29 20:27:50 +0800
commit850817b63dce20f1ec8a8b40351be77b468cd2a2 (patch)
tree74e59f1577efb830c177c891a76338a1c9d33318
parent2bb45ebc6b66ac9368c3a51b89136eef3ec9f519 (diff)
downloadandroid_frameworks_opt_telephony-850817b63dce20f1ec8a8b40351be77b468cd2a2.tar.gz
android_frameworks_opt_telephony-850817b63dce20f1ec8a8b40351be77b468cd2a2.tar.bz2
android_frameworks_opt_telephony-850817b63dce20f1ec8a8b40351be77b468cd2a2.zip
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
-rw-r--r--src/java/com/android/internal/telephony/SubscriptionController.java1
1 files changed, 1 insertions, 0 deletions
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<SubscriptionInfo> activeSubscriptionInfoList = getSubInfo(
SubscriptionManager.SIM_SLOT_INDEX + ">=0", null);
if (activeSubscriptionInfoList != null) {
+ activeSubscriptionInfoList.sort(SUBSCRIPTION_INFO_COMPARATOR);
mCacheActiveSubInfoList.addAll(activeSubscriptionInfoList);
}
if (DBG_CACHE) {