From f4104f696ea8307ba335cbada04f8abb0b55f7e6 Mon Sep 17 00:00:00 2001 From: Moxie Marlinspike Date: Mon, 20 Jul 2015 16:41:05 -0700 Subject: [PATCH] Search TextSecure contacts by name or number. Fixes #3710 // FREEBIE --- src/org/thoughtcrime/securesms/contacts/ContactsDatabase.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/org/thoughtcrime/securesms/contacts/ContactsDatabase.java b/src/org/thoughtcrime/securesms/contacts/ContactsDatabase.java index fdf2f043c7..ceb354898f 100644 --- a/src/org/thoughtcrime/securesms/contacts/ContactsDatabase.java +++ b/src/org/thoughtcrime/securesms/contacts/ContactsDatabase.java @@ -224,9 +224,9 @@ public class ContactsDatabase { } else { cursor = context.getContentResolver().query(ContactsContract.Data.CONTENT_URI, projection, - ContactsContract.Data.MIMETYPE + " = ? AND " + ContactsContract.Contacts.DISPLAY_NAME + " LIKE ?", + ContactsContract.Data.MIMETYPE + " = ? AND (" + ContactsContract.Contacts.DISPLAY_NAME + " LIKE ? OR " + ContactsContract.Data.DATA1 + " LIKE ?)", new String[] {"vnd.android.cursor.item/vnd.org.thoughtcrime.securesms.contact", - "%" + filter + "%"}, + "%" + filter + "%", "%" + filter + "%"}, sort); }