Skip to content

Commit 327d8d6

Browse files
committed
Only set immutable flag if android 12 or newer
1 parent d1a77c9 commit 327d8d6

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

android/sdl_android/src/main/java/com/smartdevicelink/transport/SdlRouterService.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1528,7 +1528,8 @@ private void enterForeground(String content, long chronometerLength, boolean ong
15281528

15291529
// Create an intent that will be fired when the user clicks the notification.
15301530
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(SDL_NOTIFICATION_FAQS_PAGE));
1531-
PendingIntent pendingIntent = PendingIntent.getActivity(this, 0, intent, PendingIntent.FLAG_IMMUTABLE);
1531+
int flag = android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.S ? PendingIntent.FLAG_IMMUTABLE : 0;
1532+
PendingIntent pendingIntent = PendingIntent.getActivity(this, 0, intent, flag);
15321533
builder.setContentIntent(pendingIntent);
15331534

15341535
if (chronometerLength > (FOREGROUND_TIMEOUT / 1000) && android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {

0 commit comments

Comments
 (0)