properly show locally stored contact names at the Recents tab
This commit is contained in:
parent
e302309fe9
commit
2cff407b96
|
@ -540,6 +540,15 @@ class MainActivity : SimpleActivity(), RefreshContactsListener {
|
||||||
|
|
||||||
if (refreshTabsMask and RECENTS_TAB_MASK != 0) {
|
if (refreshTabsMask and RECENTS_TAB_MASK != 0) {
|
||||||
ContactsHelper(this).getRecents {
|
ContactsHelper(this).getRecents {
|
||||||
|
val localContacts = LocalContactsHelper(applicationContext).getAllContacts()
|
||||||
|
it.filter { it.name == null }.forEach {
|
||||||
|
val namelessCall = it
|
||||||
|
val localContact = localContacts.firstOrNull { it.doesContainPhoneNumber(namelessCall.number) }
|
||||||
|
if (localContact != null) {
|
||||||
|
it.name = localContact.getNameToDisplay()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
runOnUiThread {
|
runOnUiThread {
|
||||||
recents_fragment?.updateRecentCalls(it)
|
recents_fragment?.updateRecentCalls(it)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue