From b447e006f2fe30965836fd74a2557efd6cabb14c Mon Sep 17 00:00:00 2001 From: Erle Carrara Date: Tue, 28 Mar 2023 21:44:32 -0300 Subject: [PATCH] Adds `PendingIntent.FLAG_MUTABLE` to bring front PendingIntent Credits to @PieterAelse - https://github.com/Lyokone/flutterlocation/pull/640 --- .../main/java/com/lyokone/location/FlutterLocationService.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/location/android/src/main/java/com/lyokone/location/FlutterLocationService.kt b/packages/location/android/src/main/java/com/lyokone/location/FlutterLocationService.kt index afed67dd..4e9b9a11 100644 --- a/packages/location/android/src/main/java/com/lyokone/location/FlutterLocationService.kt +++ b/packages/location/android/src/main/java/com/lyokone/location/FlutterLocationService.kt @@ -53,7 +53,9 @@ class BackgroundNotification( ?.setPackage(null) ?.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED) - return if (intent != null) { + return if (intent != null && Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) { + PendingIntent.getActivity(context, 0, intent, PendingIntent.FLAG_MUTABLE) + } else if (intent != null) { PendingIntent.getActivity(context, 0, intent, 0) } else { null