store the subscription ID at incoming messages too

This commit is contained in:
tibbi 2020-05-13 13:44:43 +02:00
parent 34eb659a7d
commit 6fb8d963a8
3 changed files with 7 additions and 4 deletions

View file

@ -20,6 +20,7 @@ class SmsReceiver : BroadcastReceiver() {
var threadId = 0L
val type = Telephony.Sms.MESSAGE_TYPE_INBOX
val read = 0
val subscriptionId = intent.getIntExtra("subscription", -1)
messages.forEach {
address = it.originatingAddress ?: ""
@ -30,7 +31,7 @@ class SmsReceiver : BroadcastReceiver() {
}
if (!context.isNumberBlocked(address)) {
context.insertNewSMS(address, subject, body, date, read, threadId, type)
context.insertNewSMS(address, subject, body, date, read, threadId, type, subscriptionId)
context.showReceivedMessageNotification(address, body, threadId.toInt())
refreshMessages()
}