diff options
author | cyBerta <cyberta@riseup.net> | 2022-08-08 22:59:50 +0200 |
---|---|---|
committer | cyBerta <cyberta@riseup.net> | 2022-08-08 22:59:50 +0200 |
commit | 6d705263bf0fd616926d2c64ada98e2ee7740024 (patch) | |
tree | fbf62008d9bc382dd4945ac9729f7347c5c57fa1 /app/src/main/java/se/leap/bitmaskclient/base | |
parent | fa5beea3c70a5e20304953b8dbf778ca8f338536 (diff) |
set IMMUTABLE flags for PendingIntents on Android 12+
Diffstat (limited to 'app/src/main/java/se/leap/bitmaskclient/base')
-rw-r--r-- | app/src/main/java/se/leap/bitmaskclient/base/utils/ConfigHelper.java | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/app/src/main/java/se/leap/bitmaskclient/base/utils/ConfigHelper.java b/app/src/main/java/se/leap/bitmaskclient/base/utils/ConfigHelper.java index 91894fb8..96518a8e 100644 --- a/app/src/main/java/se/leap/bitmaskclient/base/utils/ConfigHelper.java +++ b/app/src/main/java/se/leap/bitmaskclient/base/utils/ConfigHelper.java @@ -18,6 +18,7 @@ package se.leap.bitmaskclient.base.utils; import static se.leap.bitmaskclient.base.models.Constants.DEFAULT_BITMASK; +import android.app.PendingIntent; import android.content.Context; import android.content.res.Resources; import android.os.Build; @@ -307,4 +308,12 @@ public class ConfigHelper { return BuildConfig.obfsvpn_use_kcp; } } + + public static int getPendingIntentFlags() { + int flags = PendingIntent.FLAG_CANCEL_CURRENT; + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) { + flags |= PendingIntent.FLAG_IMMUTABLE; + } + return flags; + } } |