aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/kotlin
diff options
context:
space:
mode:
authorAllan Wang <me@allanwang.ca>2019-04-13 20:03:15 -0400
committerAllan Wang <me@allanwang.ca>2019-04-13 20:03:15 -0400
commitedfa56908bc30bcf3185a744ab87eee49a62dce3 (patch)
tree784cbfab69ac8154340de341de287a9e412218b0 /app/src/main/kotlin
parent28fda2ded662952e4488df3753b77c0afb69ef26 (diff)
downloadfrost-edfa56908bc30bcf3185a744ab87eee49a62dce3.tar.gz
frost-edfa56908bc30bcf3185a744ab87eee49a62dce3.tar.bz2
frost-edfa56908bc30bcf3185a744ab87eee49a62dce3.zip
Delete notification channels after creating new ones, may resolve #1360
Diffstat (limited to 'app/src/main/kotlin')
-rw-r--r--app/src/main/kotlin/com/pitchedapps/frost/services/NotificationUtils.kt4
1 files changed, 2 insertions, 2 deletions
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/services/NotificationUtils.kt b/app/src/main/kotlin/com/pitchedapps/frost/services/NotificationUtils.kt
index 20a497e3..bba2a9a1 100644
--- a/app/src/main/kotlin/com/pitchedapps/frost/services/NotificationUtils.kt
+++ b/app/src/main/kotlin/com/pitchedapps/frost/services/NotificationUtils.kt
@@ -46,14 +46,14 @@ fun setupNotificationChannels(c: Context) {
val manager = c.getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager
val appName = c.string(R.string.frost_name)
val msg = c.string(R.string.messages)
+ manager.createNotificationChannel(NOTIF_CHANNEL_GENERAL, appName)
+ manager.createNotificationChannel(NOTIF_CHANNEL_MESSAGES, "$appName: $msg")
manager.notificationChannels
.filter {
it.id != NOTIF_CHANNEL_GENERAL &&
it.id != NOTIF_CHANNEL_MESSAGES
}
.forEach { manager.deleteNotificationChannel(it.id) }
- manager.createNotificationChannel(NOTIF_CHANNEL_GENERAL, appName)
- manager.createNotificationChannel(NOTIF_CHANNEL_MESSAGES, "$appName: $msg")
L.d { "Created notification channels: ${manager.notificationChannels.size} channels, ${manager.notificationChannelGroups.size} groups" }
}