Skip to content

Commit 58733b6

Browse files
committed
Add IMMUTABLE flag to PendingIntents
1 parent 353023c commit 58733b6

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

app/src/main/java/com/gianlu/aria2app/services/NotificationService.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ private Notification createForegroundServiceNotification() {
285285
.setColor(ContextCompat.getColor(this, R.color.colorAccent))
286286
.setLargeIcon(BitmapFactory.decodeResource(getResources(), R.drawable.ic_launcher))
287287
.addAction(new NotificationCompat.Action(R.drawable.baseline_clear_24, getString(R.string.stopService), PendingIntent.getService(this, 1, new Intent(this, NotificationService.class).setAction(ACTION_STOP), PendingIntent.FLAG_UPDATE_CURRENT)))
288-
.setContentIntent(PendingIntent.getActivity(this, 1, new Intent(this, LoadingActivity.class), PendingIntent.FLAG_UPDATE_CURRENT));
288+
.setContentIntent(PendingIntent.getActivity(this, 1, new Intent(this, LoadingActivity.class), PendingIntent.FLAG_UPDATE_CURRENT | PendingIntent.FLAG_IMMUTABLE));
289289

290290
return builder.build();
291291
}
@@ -341,7 +341,7 @@ private void handleEvent(@NonNull MultiProfile.UserProfile profile, @NonNull Str
341341
bundle.putString("profileId", profile.getParent().id);
342342
bundle.putString("gid", gid);
343343
builder.setContentIntent(PendingIntent.getActivity(this, 1, new Intent(this, LoadingActivity.class)
344-
.putExtras(bundle), PendingIntent.FLAG_UPDATE_CURRENT));
344+
.putExtras(bundle), PendingIntent.FLAG_UPDATE_CURRENT| PendingIntent.FLAG_IMMUTABLE));
345345

346346
notificationManager.notify(ThreadLocalRandom.current().nextInt(), builder.build());
347347
}

0 commit comments

Comments
 (0)