Access db on background thread
See https://github.com/FossifyOrg/Messages/issues/287
This commit is contained in:
parent
ddc0e8aa3c
commit
5f6ec81269
1 changed files with 3 additions and 1 deletions
|
|
@ -85,8 +85,10 @@ class MmsReceiver : MmsReceivedReceiver() {
|
|||
threadId = mms.threadId,
|
||||
bitmap = glideBitmap
|
||||
)
|
||||
val conversation = context.getConversations(mms.threadId).firstOrNull() ?: return@post
|
||||
|
||||
ensureBackgroundThread {
|
||||
val conversation = context.getConversations(mms.threadId).firstOrNull()
|
||||
?: return@ensureBackgroundThread
|
||||
context.insertOrUpdateConversation(conversation)
|
||||
context.updateUnreadCountBadge(context.conversationsDB.getUnreadConversations())
|
||||
refreshMessages()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue