diff --git a/app/src/main/java/com/beemdevelopment/aegis/services/NotificationService.java b/app/src/main/java/com/beemdevelopment/aegis/services/NotificationService.java index 489d8b6b..43bb28b2 100644 --- a/app/src/main/java/com/beemdevelopment/aegis/services/NotificationService.java +++ b/app/src/main/java/com/beemdevelopment/aegis/services/NotificationService.java @@ -1,8 +1,10 @@ package com.beemdevelopment.aegis.services; +import android.annotation.SuppressLint; import android.app.PendingIntent; import android.app.Service; import android.content.Intent; +import android.os.Build; import android.os.IBinder; import androidx.annotation.Nullable; @@ -24,9 +26,14 @@ public class NotificationService extends Service { return Service.START_STICKY; } + @SuppressLint("LaunchActivityFromNotification") public void serviceMethod() { + int flags = 0; + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { + flags |= PendingIntent.FLAG_IMMUTABLE; + } Intent intentAction = new Intent(CODE_LOCK_VAULT_ACTION); - PendingIntent lockDatabaseIntent = PendingIntent.getBroadcast(this, 1, intentAction, 0); + PendingIntent lockDatabaseIntent = PendingIntent.getBroadcast(this, 1, intentAction, flags); NotificationCompat.Builder builder = new NotificationCompat.Builder(this, CODE_LOCK_STATUS_ID) .setSmallIcon(R.drawable.ic_fingerprint_black_24dp) .setContentTitle(getString(R.string.app_name_full))