From 325e6ec43f34cec87b81927609f4c7b74fad0be6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Corre=CC=82a?= Date: Mon, 30 Aug 2021 16:32:51 +0100 Subject: [PATCH] feat: changes to compliance with android 12 references: https://outsystemsrd.atlassian.net/browse/RMET-824 desc: added tag exported in android manifest and added flag immutable to pending intent --- .../onesignal/src/main/AndroidManifest.xml | 35 ++++++++++++------- .../com/onesignal/GenerateNotification.java | 4 +-- 2 files changed, 25 insertions(+), 14 deletions(-) diff --git a/OneSignalSDK/onesignal/src/main/AndroidManifest.xml b/OneSignalSDK/onesignal/src/main/AndroidManifest.xml index 0a711e8807..6637214492 100644 --- a/OneSignalSDK/onesignal/src/main/AndroidManifest.xml +++ b/OneSignalSDK/onesignal/src/main/AndroidManifest.xml @@ -61,7 +61,8 @@ - + - + + android:theme="@android:style/Theme.Translucent.NoTitleBar" + android:exported="true"> - + + android:permission="android.permission.BIND_JOB_SERVICE" + exported="false"/> + android:permission="android.permission.BIND_JOB_SERVICE" + android:exported="false"/> + android:permission="android.permission.BIND_JOB_SERVICE" + android:exported="false"/> + android:permission="android.permission.BIND_JOB_SERVICE" + android:exported="false"/> + android:theme="@android:style/Theme.Translucent.NoTitleBar" + android:exported="false"/> - + - + - + diff --git a/OneSignalSDK/onesignal/src/main/java/com/onesignal/GenerateNotification.java b/OneSignalSDK/onesignal/src/main/java/com/onesignal/GenerateNotification.java index b3fe4a7dc9..a8f816413f 100644 --- a/OneSignalSDK/onesignal/src/main/java/com/onesignal/GenerateNotification.java +++ b/OneSignalSDK/onesignal/src/main/java/com/onesignal/GenerateNotification.java @@ -191,8 +191,8 @@ private static CharSequence getTitle(JSONObject gcmBundle) { private static PendingIntent getNewActionPendingIntent(int requestCode, Intent intent) { if (openerIsBroadcast) - return PendingIntent.getBroadcast(currentContext, requestCode, intent, PendingIntent.FLAG_UPDATE_CURRENT); - return PendingIntent.getActivity(currentContext, requestCode, intent, PendingIntent.FLAG_UPDATE_CURRENT); + return PendingIntent.getBroadcast(currentContext, requestCode, intent, PendingIntent.FLAG_UPDATE_CURRENT | PendingIntent.FLAG_IMMUTABLE); + return PendingIntent.getActivity(currentContext, requestCode, intent, PendingIntent.FLAG_UPDATE_CURRENT | PendingIntent.FLAG_IMMUTABLE); } private static Intent getNewBaseIntent(int notificationId) {