Fixed some pending intents on Android 12 that needs to be mutable

This commit is contained in:
Sylvain Berfini 2021-09-13 16:31:06 +02:00
parent e6729b1a69
commit 3f7f0a3d33

View file

@ -619,6 +619,7 @@ class NotificationsManager(private val context: Context) {
.setArguments(args)
.createPendingIntent()
// PendingIntents attached to bubbles must be mutable
val target = Intent(context, ChatBubbleActivity::class.java)
target.putExtra("RemoteSipUri", peerAddress)
target.putExtra("LocalSipUri", localAddress)
@ -626,7 +627,7 @@ class NotificationsManager(private val context: Context) {
context,
notifiable.notificationId,
target,
PendingIntent.FLAG_UPDATE_CURRENT or PendingIntent.FLAG_IMMUTABLE
PendingIntent.FLAG_UPDATE_CURRENT or PendingIntent.FLAG_MUTABLE
)
val id = LinphoneUtils.getChatRoomId(localAddress, peerAddress)
@ -876,11 +877,12 @@ class NotificationsManager(private val context: Context) {
replyIntent.putExtra(INTENT_LOCAL_IDENTITY, notifiable.localIdentity)
replyIntent.putExtra(INTENT_REMOTE_ADDRESS, notifiable.remoteAddress)
// PendingIntents attached to actions with remote inputs must be mutable
val replyPendingIntent = PendingIntent.getBroadcast(
context,
notifiable.notificationId,
replyIntent,
PendingIntent.FLAG_UPDATE_CURRENT or PendingIntent.FLAG_IMMUTABLE
PendingIntent.FLAG_UPDATE_CURRENT or PendingIntent.FLAG_MUTABLE
)
return NotificationCompat.Action.Builder(
R.drawable.chat_send_over,