Store system contacts display name in recipient preferences db

// FREEBIE
This commit is contained in:
Moxie Marlinspike
2017-08-07 15:31:12 -07:00
parent f61c52aace
commit 159fdb317f
7 changed files with 89 additions and 44 deletions

View File

@@ -78,6 +78,10 @@ public class ContactAccessor {
return results;
}
public Cursor getAllSystemContacts(Context context) {
return context.getContentResolver().query(Phone.CONTENT_URI, new String[] {Phone.NUMBER, Phone.DISPLAY_NAME}, null, null, null);
}
public boolean isSystemContact(Context context, String number) {
Uri uri = Uri.withAppendedPath(PhoneLookup.CONTENT_FILTER_URI, Uri.encode(number));
String[] projection = new String[]{PhoneLookup.DISPLAY_NAME, PhoneLookup.LOOKUP_KEY,