From 9ec1115a3b8952b9b8b2402c11151f6d1ab4260f Mon Sep 17 00:00:00 2001 From: Audrius Molis Date: Tue, 20 Sep 2022 13:50:16 +0300 Subject: [PATCH] Migrate to API 31 for android (#14032) --- android/app/src/main/AndroidManifest.xml | 1 + android/gradle.properties | 4 ++-- .../pushnotifications/ForegroundService.java | 5 +++-- .../pushnotifications/PushNotificationHelper.java | 14 +++++++++----- nix/pkgs/android-sdk/compose.nix | 2 +- 5 files changed, 16 insertions(+), 10 deletions(-) diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index 6c53ecda89..ea136534e2 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -36,6 +36,7 @@ = Build.VERSION_CODES.M) { notification.addAction(new NotificationCompat.Action.Builder(icon, action, pendingActionIntent).build()); @@ -708,26 +708,30 @@ public class PushNotificationHelper { Intent intent = new Intent(ACTION_DELETE_NOTIFICATION); intent.putExtra("im.status.ethereum.deepLink", deepLink); intent.putExtra("im.status.ethereum.groupId", groupId); - return PendingIntent.getBroadcast(context.getApplicationContext(), notificationId, intent, PendingIntent.FLAG_CANCEL_CURRENT); + return PendingIntent.getBroadcast(context.getApplicationContext(), notificationId, intent, + PendingIntent.FLAG_CANCEL_CURRENT | PendingIntent.FLAG_MUTABLE); } private PendingIntent createGroupOnTapIntent(Context context, int notificationId, String groupId, String deepLink) { Intent intent = new Intent(ACTION_TAP_NOTIFICATION); intent.putExtra("im.status.ethereum.deepLink", deepLink); intent.putExtra("im.status.ethereum.groupId", groupId); - return PendingIntent.getBroadcast(context.getApplicationContext(), notificationId, intent, PendingIntent.FLAG_CANCEL_CURRENT); + return PendingIntent.getBroadcast(context.getApplicationContext(), notificationId, intent, + PendingIntent.FLAG_CANCEL_CURRENT | PendingIntent.FLAG_MUTABLE); } private PendingIntent createOnTapIntent(Context context, int notificationId, String deepLink) { Intent intent = new Intent(ACTION_TAP_NOTIFICATION); intent.putExtra("im.status.ethereum.deepLink", deepLink); - return PendingIntent.getBroadcast(context.getApplicationContext(), notificationId, intent, PendingIntent.FLAG_CANCEL_CURRENT); + return PendingIntent.getBroadcast(context.getApplicationContext(), notificationId, intent, + PendingIntent.FLAG_CANCEL_CURRENT | PendingIntent.FLAG_MUTABLE); } private PendingIntent createOnDismissedIntent(Context context, int notificationId, String deepLink) { Intent intent = new Intent(ACTION_DELETE_NOTIFICATION); intent.putExtra("im.status.ethereum.deepLink", deepLink); - return PendingIntent.getBroadcast(context.getApplicationContext(), notificationId, intent, PendingIntent.FLAG_CANCEL_CURRENT); + return PendingIntent.getBroadcast(context.getApplicationContext(), notificationId, intent, + PendingIntent.FLAG_CANCEL_CURRENT | PendingIntent.FLAG_MUTABLE); } public void removeStatusMessage(Bundle bundle) { diff --git a/nix/pkgs/android-sdk/compose.nix b/nix/pkgs/android-sdk/compose.nix index 152cd4729d..525692bbc5 100644 --- a/nix/pkgs/android-sdk/compose.nix +++ b/nix/pkgs/android-sdk/compose.nix @@ -11,7 +11,7 @@ androidenv.composeAndroidPackages { toolsVersion = "26.1.1"; platformToolsVersion = "33.0.1"; buildToolsVersions = [ "31.0.0" ]; - platformVersions = [ "30" ]; + platformVersions = [ "31" ]; cmakeVersions = [ "3.18.1" ]; ndkVersion = "22.1.7171670"; includeNDK = true;