From 3f7f0a3d33a99f4123e91895c14b2dcc084255a2 Mon Sep 17 00:00:00 2001 From: Sylvain Berfini Date: Mon, 13 Sep 2021 16:31:06 +0200 Subject: [PATCH] Fixed some pending intents on Android 12 that needs to be mutable --- .../java/org/linphone/notifications/NotificationsManager.kt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/org/linphone/notifications/NotificationsManager.kt b/app/src/main/java/org/linphone/notifications/NotificationsManager.kt index 0650388e9..514c7a742 100644 --- a/app/src/main/java/org/linphone/notifications/NotificationsManager.kt +++ b/app/src/main/java/org/linphone/notifications/NotificationsManager.kt @@ -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,