Merge pull request #302 from FossifyOrg/access_db_in_background
Access db on background thread
This commit is contained in:
commit
efaa231692
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