From b210250c8fd635925e2ceed0c615c04f381831b8 Mon Sep 17 00:00:00 2001 From: Niko Diamadis Date: Sat, 22 Oct 2022 11:47:14 +0200 Subject: [PATCH 1/2] Increase minSdkVersion to 23 --- app/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/build.gradle b/app/build.gradle index 6d1473f..ed9baf1 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -7,7 +7,7 @@ android { compileSdkVersion 30 defaultConfig { applicationId "com.github.gotify" - minSdkVersion 19 + minSdkVersion 23 targetSdkVersion 30 versionCode 26 versionName "2.4.0" From d7cd9a24b041c13e0acb2a99ca873c840fba7c3d Mon Sep 17 00:00:00 2001 From: Niko Diamadis Date: Sat, 22 Oct 2022 11:57:24 +0200 Subject: [PATCH 2/2] Satisfy new PendingIntent requirements for api version 31 --- .../github/gotify/service/WebSocketService.java | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/com/github/gotify/service/WebSocketService.java b/app/src/main/java/com/github/gotify/service/WebSocketService.java index 658fc91..7143112 100644 --- a/app/src/main/java/com/github/gotify/service/WebSocketService.java +++ b/app/src/main/java/com/github/gotify/service/WebSocketService.java @@ -240,7 +240,9 @@ public class WebSocketService extends Service { private void showForegroundNotification(String title, String message) { Intent notificationIntent = new Intent(this, MessagesActivity.class); - PendingIntent pendingIntent = PendingIntent.getActivity(this, 0, notificationIntent, 0); + PendingIntent pendingIntent = + PendingIntent.getActivity( + this, 0, notificationIntent, PendingIntent.FLAG_IMMUTABLE); NotificationCompat.Builder notificationBuilder = new NotificationCompat.Builder(this, NotificationSupport.Channel.FOREGROUND); @@ -300,7 +302,11 @@ public class WebSocketService extends Service { } PendingIntent contentIntent = - PendingIntent.getActivity(this, 0, intent, PendingIntent.FLAG_UPDATE_CURRENT); + PendingIntent.getActivity( + this, + 0, + intent, + PendingIntent.FLAG_UPDATE_CURRENT | PendingIntent.FLAG_IMMUTABLE); NotificationCompat.Builder b = new NotificationCompat.Builder( @@ -353,7 +359,11 @@ public class WebSocketService extends Service { public void showNotificationGroup(long priority) { Intent intent = new Intent(this, MessagesActivity.class); PendingIntent contentIntent = - PendingIntent.getActivity(this, 0, intent, PendingIntent.FLAG_UPDATE_CURRENT); + PendingIntent.getActivity( + this, + 0, + intent, + PendingIntent.FLAG_UPDATE_CURRENT | PendingIntent.FLAG_IMMUTABLE); NotificationCompat.Builder b = new NotificationCompat.Builder(