diff options
author | Docile-Alligator <25734209+Docile-Alligator@users.noreply.github.com> | 2024-01-29 14:56:26 +0000 |
---|---|---|
committer | Docile-Alligator <25734209+Docile-Alligator@users.noreply.github.com> | 2024-01-29 14:56:26 +0000 |
commit | 96702436f482948c652b21c711fe203b82e5168f (patch) | |
tree | 1d13e9570e5c2065d5065a8e8417af234384e5f1 /app/src/main/java/ml/docilealligator/infinityforreddit | |
parent | cf91d031229c7c9ff1ac8dcd51a70712d43ae5b4 (diff) | |
download | infinity-for-reddit-96702436f482948c652b21c711fe203b82e5168f.tar infinity-for-reddit-96702436f482948c652b21c711fe203b82e5168f.tar.gz infinity-for-reddit-96702436f482948c652b21c711fe203b82e5168f.tar.bz2 infinity-for-reddit-96702436f482948c652b21c711fe203b82e5168f.tar.lz infinity-for-reddit-96702436f482948c652b21c711fe203b82e5168f.tar.xz infinity-for-reddit-96702436f482948c652b21c711fe203b82e5168f.tar.zst infinity-for-reddit-96702436f482948c652b21c711fe203b82e5168f.zip |
Fix IllegalArgumentException when sending notifications in DownloadRedditVideoService.
Diffstat (limited to 'app/src/main/java/ml/docilealligator/infinityforreddit')
-rw-r--r-- | app/src/main/java/ml/docilealligator/infinityforreddit/services/DownloadRedditVideoService.java | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/services/DownloadRedditVideoService.java b/app/src/main/java/ml/docilealligator/infinityforreddit/services/DownloadRedditVideoService.java index 0fbaf4c1..3328e833 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/services/DownloadRedditVideoService.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/services/DownloadRedditVideoService.java @@ -662,6 +662,9 @@ public class DownloadRedditVideoService extends Service { deleteIntent.putExtra(DownloadedMediaDeleteActionBroadcastReceiver.EXTRA_NOTIFICATION_ID, NotificationUtils.DOWNLOAD_REDDIT_VIDEO_NOTIFICATION_ID + randomNotificationIdOffset); PendingIntent deleteActionPendingIntent = Build.VERSION.SDK_INT >= Build.VERSION_CODES.M ? PendingIntent.getBroadcast(this, 2, deleteIntent, PendingIntent.FLAG_CANCEL_CURRENT | PendingIntent.FLAG_IMMUTABLE) : PendingIntent.getBroadcast(this, 2, deleteIntent, PendingIntent.FLAG_CANCEL_CURRENT); builder.addAction(new NotificationCompat.Action(R.drawable.ic_notification, getString(R.string.delete), deleteActionPendingIntent)); + } else { + builder.setContentIntent(null); + builder.clearActions(); } notificationManager.notify(NotificationUtils.DOWNLOAD_REDDIT_VIDEO_NOTIFICATION_ID + randomNotificationIdOffset, builder.build()); } |