summaryrefslogtreecommitdiffstats
path: root/src/com/android/messaging/datamodel
diff options
context:
space:
mode:
authorTaesu Lee <taesu82.lee@samsung.com>2019-08-01 18:36:04 +0900
committerMichael Bestas <mkbestas@lineageos.org>2019-09-15 01:37:54 +0300
commit7ade884e9ba519a590ccf92be37551363252db4f (patch)
tree636159d7ec5cb8b413d1ab2a1ff8fef2871b5786 /src/com/android/messaging/datamodel
parent35300f7692f2a7c1c34c16578f66e8d98067154f (diff)
downloadpackages_apps_Messaging-7ade884e9ba519a590ccf92be37551363252db4f.tar.gz
packages_apps_Messaging-7ade884e9ba519a590ccf92be37551363252db4f.tar.bz2
packages_apps_Messaging-7ade884e9ba519a590ccf92be37551363252db4f.zip
Sort ParticipantsData in order of the slot id
getSelfParticipants() returns the ParticipantData list arranged in ascending order of the slot id to show SIM UIs from lowest to highest id consistently. Test: Verify SettingsFragment and SimSelector order in multi-sim device Change-Id: I0f5f27c6467cb21a6d11271d1a0a6beef36630a6 Signed-off-by: Taesu Lee <taesu82.lee@samsung.com>
Diffstat (limited to 'src/com/android/messaging/datamodel')
-rw-r--r--src/com/android/messaging/datamodel/data/SelfParticipantsData.java11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/com/android/messaging/datamodel/data/SelfParticipantsData.java b/src/com/android/messaging/datamodel/data/SelfParticipantsData.java
index fc4027f..f389a78 100644
--- a/src/com/android/messaging/datamodel/data/SelfParticipantsData.java
+++ b/src/com/android/messaging/datamodel/data/SelfParticipantsData.java
@@ -20,6 +20,8 @@ import android.database.Cursor;
import androidx.collection.ArrayMap;
import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Comparator;
import java.util.List;
import com.android.messaging.util.OsUtil;
@@ -61,6 +63,15 @@ public class SelfParticipantsData {
list.add(self);
}
}
+ Collections.sort(
+ list,
+ new Comparator() {
+ public int compare(Object o1, Object o2) {
+ int slotId1 = ((ParticipantData) o1).getSlotId();
+ int slotId2 = ((ParticipantData) o2).getSlotId();
+ return slotId1 > slotId2 ? 1 : -1;
+ }
+ });
return list;
}