Fixed deadlock causing ANR because SDK method was called directly in adapter

This commit is contained in:
Sylvain Berfini 2024-12-16 16:39:26 +01:00
parent 31b9836cc0
commit d4b0356bda
2 changed files with 3 additions and 1 deletions

View file

@ -90,7 +90,7 @@ class ConversationsContactsAndSuggestionsListAdapter :
return if (model.localAddress != null) { return if (model.localAddress != null) {
CONVERSATION_TYPE CONVERSATION_TYPE
} else if (model.friend != null) { } else if (model.friend != null) {
if (model.friend.starred) { if (model.starred) {
FAVORITE_TYPE FAVORITE_TYPE
} else { } else {
CONTACT_TYPE CONTACT_TYPE

View file

@ -39,6 +39,8 @@ class ConversationContactOrSuggestionModel
) { ) {
val id = friend?.refKey ?: address.asStringUriOnly().hashCode() val id = friend?.refKey ?: address.asStringUriOnly().hashCode()
val starred = friend?.starred == true
val name = conversationSubject val name = conversationSubject
?: if (friend != null) { ?: if (friend != null) {
friend.name ?: LinphoneUtils.getDisplayName(address) friend.name ?: LinphoneUtils.getDisplayName(address)