improve name recognition at receiving calls

This commit is contained in:
tibbi
2020-09-18 22:16:41 +02:00
parent 0eab858ca3
commit 746d735d3a

View File

@ -74,7 +74,7 @@ class CallManager {
val privateCursor = context.getMyContactsCursor().loadInBackground() val privateCursor = context.getMyContactsCursor().loadInBackground()
ensureBackgroundThread { ensureBackgroundThread {
val privateContacts = MyContactsContentProvider.getSimpleContacts(context, privateCursor) val privateContacts = MyContactsContentProvider.getSimpleContacts(context, privateCursor)
val privateContact = privateContacts.firstOrNull { it.phoneNumbers.first() == callContact.number } val privateContact = privateContacts.firstOrNull { it.doesContainPhoneNumber(callContact.number) }
if (privateContact != null) { if (privateContact != null) {
callContact.name = privateContact.name callContact.name = privateContact.name
} }