From 2e5e1c1f6e57e83de114b976fa446e2720c21c7e Mon Sep 17 00:00:00 2001 From: Mygod Date: Thu, 27 May 2021 13:35:27 -0400 Subject: [PATCH] Set immutable flag on PendingIntent --- .../be/mygod/vpnhotspot/ServiceNotification.kt | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/mobile/src/main/java/be/mygod/vpnhotspot/ServiceNotification.kt b/mobile/src/main/java/be/mygod/vpnhotspot/ServiceNotification.kt index fd7c8853..6609c2c0 100644 --- a/mobile/src/main/java/be/mygod/vpnhotspot/ServiceNotification.kt +++ b/mobile/src/main/java/be/mygod/vpnhotspot/ServiceNotification.kt @@ -21,14 +21,14 @@ object ServiceNotification { private fun buildNotification(context: Context): Notification { val builder = NotificationCompat.Builder(context, CHANNEL) - .setWhen(0) - .setCategory(NotificationCompat.CATEGORY_SERVICE) - .setColor(ContextCompat.getColor(context, R.color.colorPrimary)) - .setContentTitle(context.getText(R.string.notification_tethering_title)) - .setSmallIcon(R.drawable.ic_quick_settings_tile_on) - .setContentIntent(PendingIntent.getActivity(context, 0, - Intent(context, MainActivity::class.java), PendingIntent.FLAG_UPDATE_CURRENT)) - .setVisibility(NotificationCompat.VISIBILITY_PUBLIC) + .setWhen(0) + .setCategory(NotificationCompat.CATEGORY_SERVICE) + .setColor(ContextCompat.getColor(context, R.color.colorPrimary)) + .setContentTitle(context.getText(R.string.notification_tethering_title)) + .setSmallIcon(R.drawable.ic_quick_settings_tile_on) + .setContentIntent(PendingIntent.getActivity(context, 0, Intent(context, MainActivity::class.java), + PendingIntent.FLAG_UPDATE_CURRENT or PendingIntent.FLAG_IMMUTABLE)) + .setVisibility(NotificationCompat.VISIBILITY_PUBLIC) val deviceCounts = deviceCountsMap.values.flatMap { it.entries }.sortedBy { it.key } val inactive = inactiveMap.values.flatten() var lines = deviceCounts.map { (dev, size) ->