From be09dded2047eee79f241bf044ede3d65f088984 Mon Sep 17 00:00:00 2001 From: arkon Date: Fri, 1 May 2020 19:29:15 -0400 Subject: [PATCH] Attempt to remove sound from backup/restore completion notifications --- .../tachiyomi/data/notification/Notifications.kt | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/notification/Notifications.kt b/app/src/main/java/eu/kanade/tachiyomi/data/notification/Notifications.kt index c3627e47c..6fd4f3c98 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/notification/Notifications.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/notification/Notifications.kt @@ -53,10 +53,14 @@ object Notifications { const val CHANNEL_BACKUP_RESTORE_PROGRESS = "backup_restore_progress_channel" const val ID_BACKUP_PROGRESS = -501 const val ID_RESTORE_PROGRESS = -503 - const val CHANNEL_BACKUP_RESTORE_COMPLETE = "backup_restore_complete_channel" + const val CHANNEL_BACKUP_RESTORE_COMPLETE = "backup_restore_complete_channel_v2" const val ID_BACKUP_COMPLETE = -502 const val ID_RESTORE_COMPLETE = -504 + private val deprecatedChannels = listOf( + "backup_restore_complete_channel" + ) + /** * Creates the notification channels introduced in Android Oreo. * @@ -106,8 +110,14 @@ object Notifications { ).apply { group = GROUP_BACK_RESTORE setShowBadge(false) + setSound(null, null) } ) context.notificationManager.createNotificationChannels(channels) + + // Delete old notification channels + deprecatedChannels.forEach { + context.notificationManager.deleteNotificationChannel(it) + } } }