From b5b4f85e5949558c807c39dd820970280e8f41fb Mon Sep 17 00:00:00 2001 From: tibbi Date: Tue, 12 Apr 2022 14:33:42 +0200 Subject: [PATCH] add the FLAG_IMMUTABLE flag at PendingIntents --- .../dialer/helpers/CallNotificationManager.kt | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/dialer/helpers/CallNotificationManager.kt b/app/src/main/kotlin/com/simplemobiletools/dialer/helpers/CallNotificationManager.kt index d15c64a8..9c70476c 100644 --- a/app/src/main/kotlin/com/simplemobiletools/dialer/helpers/CallNotificationManager.kt +++ b/app/src/main/kotlin/com/simplemobiletools/dialer/helpers/CallNotificationManager.kt @@ -42,15 +42,17 @@ class CallNotificationManager(private val context: Context) { } val openAppIntent = CallActivity.getStartIntent(context) - val openAppPendingIntent = PendingIntent.getActivity(context, 0, openAppIntent, 0) + val openAppPendingIntent = PendingIntent.getActivity(context, 0, openAppIntent, PendingIntent.FLAG_IMMUTABLE) val acceptCallIntent = Intent(context, CallActionReceiver::class.java) acceptCallIntent.action = ACCEPT_CALL - val acceptPendingIntent = PendingIntent.getBroadcast(context, ACCEPT_CALL_CODE, acceptCallIntent, PendingIntent.FLAG_CANCEL_CURRENT) + val acceptPendingIntent = + PendingIntent.getBroadcast(context, ACCEPT_CALL_CODE, acceptCallIntent, PendingIntent.FLAG_CANCEL_CURRENT or PendingIntent.FLAG_IMMUTABLE) val declineCallIntent = Intent(context, CallActionReceiver::class.java) declineCallIntent.action = DECLINE_CALL - val declinePendingIntent = PendingIntent.getBroadcast(context, DECLINE_CALL_CODE, declineCallIntent, PendingIntent.FLAG_CANCEL_CURRENT) + val declinePendingIntent = + PendingIntent.getBroadcast(context, DECLINE_CALL_CODE, declineCallIntent, PendingIntent.FLAG_CANCEL_CURRENT or PendingIntent.FLAG_IMMUTABLE) var callerName = if (callContact != null && callContact.name.isNotEmpty()) callContact.name else context.getString(R.string.unknown_caller) if (callContact?.numberLabel?.isNotEmpty() == true) {