make sure sent messages have proper SIM card associated
This commit is contained in:
parent
099caf96eb
commit
cf75ab71d4
7 changed files with 70 additions and 12 deletions
|
|
@ -554,6 +554,16 @@ fun Context.markThreadMessagesUnread(threadId: Long) {
|
|||
}
|
||||
}
|
||||
|
||||
fun Context.updateMessageSubscriptionId(messageId: Long, subscriptionId: Int) {
|
||||
val uri = Sms.CONTENT_URI
|
||||
val contentValues = ContentValues().apply {
|
||||
put(Sms.SUBSCRIPTION_ID, subscriptionId)
|
||||
}
|
||||
val selection = "${Sms._ID} = ?"
|
||||
val selectionArgs = arrayOf(messageId.toString())
|
||||
contentResolver.update(uri, contentValues, selection, selectionArgs)
|
||||
}
|
||||
|
||||
fun Context.updateUnreadCountBadge(conversations: List<Conversation>) {
|
||||
val unreadCount = conversations.count { !it.read }
|
||||
if (unreadCount == 0) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue