From 468eb3382c3dc47864d067e9eabe51f44daed5c4 Mon Sep 17 00:00:00 2001 From: Michael Bennett Date: Sun, 9 Feb 2014 14:28:10 -0800 Subject: [PATCH] Add sorting by default phone number Currently the order of numbers is times contacted -> displayName -> phone type (mobile vs. home, etc.). This adds whether the number has been saved as the default number for a contact to sort numbers belonging to the same contact. Fixes #580 --- src/org/thoughtcrime/securesms/contacts/ContactAccessor.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/org/thoughtcrime/securesms/contacts/ContactAccessor.java b/src/org/thoughtcrime/securesms/contacts/ContactAccessor.java index 8293ffd425..03b5addd1e 100644 --- a/src/org/thoughtcrime/securesms/contacts/ContactAccessor.java +++ b/src/org/thoughtcrime/securesms/contacts/ContactAccessor.java @@ -412,7 +412,9 @@ public class ContactAccessor { ContentResolver mContentResolver) { final String SORT_ORDER = Contacts.TIMES_CONTACTED + " DESC," + - Contacts.DISPLAY_NAME + "," + Phone.TYPE; + Contacts.DISPLAY_NAME + "," + + Contacts.Data.IS_SUPER_PRIMARY + " DESC," + + Phone.TYPE; final String[] PROJECTION_PHONE = { Phone._ID, // 0