From 6d705263bf0fd616926d2c64ada98e2ee7740024 Mon Sep 17 00:00:00 2001 From: cyBerta Date: Mon, 8 Aug 2022 22:59:50 +0200 Subject: set IMMUTABLE flags for PendingIntents on Android 12+ --- .../appUpdate/DownloadNotificationManager.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'app/src/fatweb') diff --git a/app/src/fatweb/java/se.leap.bitmaskclient/appUpdate/DownloadNotificationManager.java b/app/src/fatweb/java/se.leap.bitmaskclient/appUpdate/DownloadNotificationManager.java index 336802c6..687fc66a 100644 --- a/app/src/fatweb/java/se.leap.bitmaskclient/appUpdate/DownloadNotificationManager.java +++ b/app/src/fatweb/java/se.leap.bitmaskclient/appUpdate/DownloadNotificationManager.java @@ -33,6 +33,7 @@ import se.leap.bitmaskclient.R; import static android.content.Intent.CATEGORY_DEFAULT; import static se.leap.bitmaskclient.appUpdate.DownloadBroadcastReceiver.ACTION_DOWNLOAD; +import static se.leap.bitmaskclient.base.utils.ConfigHelper.getPendingIntentFlags; public class DownloadNotificationManager { private Context context; @@ -130,12 +131,13 @@ public class DownloadNotificationManager { private PendingIntent getDownloadIntent() { Intent downloadIntent = new Intent(context, DownloadBroadcastReceiver.class); downloadIntent.setAction(ACTION_DOWNLOAD); - return PendingIntent.getBroadcast(context, 0, downloadIntent, PendingIntent.FLAG_CANCEL_CURRENT); + + return PendingIntent.getBroadcast(context, 0, downloadIntent, getPendingIntentFlags()); } private PendingIntent getInstallIntent() { Intent installIntent = new Intent(context, InstallActivity.class); - return PendingIntent.getActivity(context, 0, installIntent, PendingIntent.FLAG_CANCEL_CURRENT); + return PendingIntent.getActivity(context, 0, installIntent, getPendingIntentFlags()); } public void cancelNotifications() { -- cgit v1.2.3