Fixed some pending intents on Android 12 that needs to be mutable
This commit is contained in:
parent
e6729b1a69
commit
3f7f0a3d33
1 changed files with 4 additions and 2 deletions
|
@ -619,6 +619,7 @@ class NotificationsManager(private val context: Context) {
|
||||||
.setArguments(args)
|
.setArguments(args)
|
||||||
.createPendingIntent()
|
.createPendingIntent()
|
||||||
|
|
||||||
|
// PendingIntents attached to bubbles must be mutable
|
||||||
val target = Intent(context, ChatBubbleActivity::class.java)
|
val target = Intent(context, ChatBubbleActivity::class.java)
|
||||||
target.putExtra("RemoteSipUri", peerAddress)
|
target.putExtra("RemoteSipUri", peerAddress)
|
||||||
target.putExtra("LocalSipUri", localAddress)
|
target.putExtra("LocalSipUri", localAddress)
|
||||||
|
@ -626,7 +627,7 @@ class NotificationsManager(private val context: Context) {
|
||||||
context,
|
context,
|
||||||
notifiable.notificationId,
|
notifiable.notificationId,
|
||||||
target,
|
target,
|
||||||
PendingIntent.FLAG_UPDATE_CURRENT or PendingIntent.FLAG_IMMUTABLE
|
PendingIntent.FLAG_UPDATE_CURRENT or PendingIntent.FLAG_MUTABLE
|
||||||
)
|
)
|
||||||
|
|
||||||
val id = LinphoneUtils.getChatRoomId(localAddress, peerAddress)
|
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_LOCAL_IDENTITY, notifiable.localIdentity)
|
||||||
replyIntent.putExtra(INTENT_REMOTE_ADDRESS, notifiable.remoteAddress)
|
replyIntent.putExtra(INTENT_REMOTE_ADDRESS, notifiable.remoteAddress)
|
||||||
|
|
||||||
|
// PendingIntents attached to actions with remote inputs must be mutable
|
||||||
val replyPendingIntent = PendingIntent.getBroadcast(
|
val replyPendingIntent = PendingIntent.getBroadcast(
|
||||||
context,
|
context,
|
||||||
notifiable.notificationId,
|
notifiable.notificationId,
|
||||||
replyIntent,
|
replyIntent,
|
||||||
PendingIntent.FLAG_UPDATE_CURRENT or PendingIntent.FLAG_IMMUTABLE
|
PendingIntent.FLAG_UPDATE_CURRENT or PendingIntent.FLAG_MUTABLE
|
||||||
)
|
)
|
||||||
return NotificationCompat.Action.Builder(
|
return NotificationCompat.Action.Builder(
|
||||||
R.drawable.chat_send_over,
|
R.drawable.chat_send_over,
|
||||||
|
|
Loading…
Reference in a new issue