summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaisuke Miyakawa <dmiyakawa@google.com>2011-06-15 18:22:42 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2011-06-15 18:22:42 -0700
commit2ad4134d2a7c1a1b8c42110712d922f07476a50a (patch)
treef1abb4d18e1fb2ee579fee3b39a8a797bee3dfc2
parent3535990c241841cdc8d65aa00c5ec0c3efaab3d8 (diff)
parent2262f0ccc800b93a9d1e63c55654ca3aaf5e7d1c (diff)
downloadpackages_providers_ContactsProvider-2ad4134d2a7c1a1b8c42110712d922f07476a50a.zip
packages_providers_ContactsProvider-2ad4134d2a7c1a1b8c42110712d922f07476a50a.tar.gz
packages_providers_ContactsProvider-2ad4134d2a7c1a1b8c42110712d922f07476a50a.tar.bz2
Merge "Prioritize IN_VISIBLE_GROUP in auto-complete."
-rw-r--r--src/com/android/providers/contacts/ContactsProvider2.java7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/com/android/providers/contacts/ContactsProvider2.java b/src/com/android/providers/contacts/ContactsProvider2.java
index ebdb3f8..24ea316 100644
--- a/src/com/android/providers/contacts/ContactsProvider2.java
+++ b/src/com/android/providers/contacts/ContactsProvider2.java
@@ -418,13 +418,16 @@ public class ContactsProvider2 extends SQLiteContentProvider implements OnAccoun
/*
* Sorting order for email address suggestions: first starred, then the rest.
- * Within the starred/unstarred groups - three buckets: very recently contacted, then fairly
+ * second in_visible_group, then the rest.
+ * Within the four (starred/unstarred, in_visible_group/not-in_visible_group) groups
+ * - three buckets: very recently contacted, then fairly
* recently contacted, then the rest. Within each of the bucket - descending count
* of times contacted (both for data row and for contact row). If all else fails, alphabetical.
* (Super)primary email address is returned before other addresses for the same contact.
*/
private static final String EMAIL_FILTER_SORT_ORDER =
- "(CASE WHEN " + Contacts.STARRED + "=1 THEN 0 ELSE 1 END), "
+ Contacts.STARRED + " DESC, "
+ + Contacts.IN_VISIBLE_GROUP + " DESC, "
+ "(CASE WHEN " + DataUsageStatColumns.LAST_TIME_USED + " < " + EMAIL_FILTER_CURRENT
+ " THEN 0 "
+ " WHEN " + DataUsageStatColumns.LAST_TIME_USED + " < " + EMAIL_FILTER_RECENT