Merge pull request #2115 from nextcloud/fixIntent

Use FLAG_IMMUTABLE if needed
This commit is contained in:
Tobias Kaminsky 2024-04-04 15:13:57 +02:00 committed by GitHub
commit 8ff268a30e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -28,7 +28,9 @@ public class WidgetUtil {
* @return {@param flags} | {@link PendingIntent#FLAG_MUTABLE}
*/
public static int pendingIntentFlagCompat(int flags) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.UPSIDE_DOWN_CAKE) {
return flags | PendingIntent.FLAG_IMMUTABLE;
} else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {
return flags | PendingIntent.FLAG_MUTABLE;
}
return flags;