Attempt to remove sound from backup/restore completion notifications

This commit is contained in:
arkon 2020-05-01 19:29:15 -04:00
parent 6493b9a6b3
commit be09dded20

View File

@ -53,10 +53,14 @@ object Notifications {
const val CHANNEL_BACKUP_RESTORE_PROGRESS = "backup_restore_progress_channel" const val CHANNEL_BACKUP_RESTORE_PROGRESS = "backup_restore_progress_channel"
const val ID_BACKUP_PROGRESS = -501 const val ID_BACKUP_PROGRESS = -501
const val ID_RESTORE_PROGRESS = -503 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_BACKUP_COMPLETE = -502
const val ID_RESTORE_COMPLETE = -504 const val ID_RESTORE_COMPLETE = -504
private val deprecatedChannels = listOf(
"backup_restore_complete_channel"
)
/** /**
* Creates the notification channels introduced in Android Oreo. * Creates the notification channels introduced in Android Oreo.
* *
@ -106,8 +110,14 @@ object Notifications {
).apply { ).apply {
group = GROUP_BACK_RESTORE group = GROUP_BACK_RESTORE
setShowBadge(false) setShowBadge(false)
setSound(null, null)
} }
) )
context.notificationManager.createNotificationChannels(channels) context.notificationManager.createNotificationChannels(channels)
// Delete old notification channels
deprecatedChannels.forEach {
context.notificationManager.deleteNotificationChannel(it)
}
} }
} }