@@ -5,7 +5,10 @@ import android.app.Notification
55import android.app.NotificationChannel
66import android.app.NotificationManager
77import android.app.PendingIntent
8- import android.content.*
8+ import android.content.ContentResolver
9+ import android.content.ContentValues
10+ import android.content.Context
11+ import android.content.Intent
912import android.database.Cursor
1013import android.graphics.Bitmap
1114import android.graphics.BitmapFactory
@@ -40,8 +43,6 @@ import com.simplemobiletools.smsmessenger.receivers.DirectReplyReceiver
4043import com.simplemobiletools.smsmessenger.receivers.MarkAsReadReceiver
4144import me.leolin.shortcutbadger.ShortcutBadger
4245import java.io.FileNotFoundException
43- import java.util.*
44- import kotlin.collections.ArrayList
4546
4647val Context .config: Config get() = Config .newInstance(applicationContext)
4748
@@ -745,14 +746,15 @@ fun Context.showMessageNotification(address: String, body: String, threadId: Lon
745746 putExtra(THREAD_ID , threadId)
746747 }
747748
748- val pendingIntent = PendingIntent .getActivity(this , threadId.hashCode(), intent, PendingIntent .FLAG_UPDATE_CURRENT )
749+ val pendingIntent = PendingIntent .getActivity(this , threadId.hashCode(), intent, PendingIntent .FLAG_UPDATE_CURRENT or PendingIntent . FLAG_IMMUTABLE )
749750 val summaryText = getString(R .string.new_message)
750751 val markAsReadIntent = Intent (this , MarkAsReadReceiver ::class .java).apply {
751752 action = MARK_AS_READ
752753 putExtra(THREAD_ID , threadId)
753754 }
754755
755- val markAsReadPendingIntent = PendingIntent .getBroadcast(this , threadId.hashCode(), markAsReadIntent, PendingIntent .FLAG_UPDATE_CURRENT )
756+ val markAsReadPendingIntent =
757+ PendingIntent .getBroadcast(this , threadId.hashCode(), markAsReadIntent, PendingIntent .FLAG_UPDATE_CURRENT or PendingIntent .FLAG_IMMUTABLE )
756758 var replyAction: NotificationCompat .Action ? = null
757759
758760 if (isNougatPlus()) {
@@ -766,7 +768,8 @@ fun Context.showMessageNotification(address: String, body: String, threadId: Lon
766768 putExtra(THREAD_NUMBER , address)
767769 }
768770
769- val replyPendingIntent = PendingIntent .getBroadcast(applicationContext, threadId.hashCode(), replyIntent, PendingIntent .FLAG_UPDATE_CURRENT )
771+ val replyPendingIntent =
772+ PendingIntent .getBroadcast(applicationContext, threadId.hashCode(), replyIntent, PendingIntent .FLAG_UPDATE_CURRENT or PendingIntent .FLAG_IMMUTABLE )
770773 replyAction = NotificationCompat .Action .Builder (R .drawable.ic_send_vector, replyLabel, replyPendingIntent)
771774 .addRemoteInput(remoteInput)
772775 .build()
0 commit comments