return empty contact source type for empty account names

This commit is contained in:
tibbi 2018-01-29 18:34:48 +01:00
parent c72a3cd604
commit 8317a267b4
1 changed files with 4 additions and 0 deletions

View File

@ -253,6 +253,10 @@ class ContactsHelper(val activity: BaseSimpleActivity) {
}
private fun getContactSourceType(accountName: String): String {
if (accountName.isEmpty()) {
return ""
}
val uri = ContactsContract.RawContacts.CONTENT_URI
val projection = arrayOf(ContactsContract.RawContacts.ACCOUNT_TYPE)
val selection = "${ContactsContract.RawContacts.ACCOUNT_NAME} = ?"