From 929efc73e947d9921e2ed6a86911342176d2c7df Mon Sep 17 00:00:00 2001 From: Sylvain Berfini Date: Wed, 2 Apr 2025 15:15:09 +0200 Subject: [PATCH] Set default values for notification channels, do not rely only on importance level --- .../linphone/notifications/NotificationsManager.kt | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/app/src/main/java/org/linphone/notifications/NotificationsManager.kt b/app/src/main/java/org/linphone/notifications/NotificationsManager.kt index 787e71073..7f60c7625 100644 --- a/app/src/main/java/org/linphone/notifications/NotificationsManager.kt +++ b/app/src/main/java/org/linphone/notifications/NotificationsManager.kt @@ -1618,6 +1618,7 @@ class NotificationsManager val channel = NotificationChannel(id, name, NotificationManager.IMPORTANCE_HIGH).apply { description = name lockscreenVisibility = Notification.VISIBILITY_PUBLIC + setShowBadge(false) } notificationManager.createNotificationChannel(channel) } @@ -1630,7 +1631,9 @@ class NotificationsManager val channel = NotificationChannel(id, name, NotificationManager.IMPORTANCE_HIGH).apply { description = name lockscreenVisibility = Notification.VISIBILITY_PUBLIC + enableLights(true) enableVibration(true) + setShowBadge(true) } notificationManager.createNotificationChannel(channel) } @@ -1643,6 +1646,9 @@ class NotificationsManager val channel = NotificationChannel(id, name, NotificationManager.IMPORTANCE_LOW).apply { description = name lockscreenVisibility = Notification.VISIBILITY_PUBLIC + enableLights(false) + enableVibration(false) + setShowBadge(false) } notificationManager.createNotificationChannel(channel) } @@ -1655,7 +1661,9 @@ class NotificationsManager val channel = NotificationChannel(id, name, NotificationManager.IMPORTANCE_HIGH).apply { description = name lockscreenVisibility = Notification.VISIBILITY_PUBLIC + enableLights(true) enableVibration(true) + setShowBadge(true) } notificationManager.createNotificationChannel(channel) } @@ -1667,6 +1675,9 @@ class NotificationsManager val channel = NotificationChannel(id, name, NotificationManager.IMPORTANCE_LOW).apply { description = context.getString(R.string.notification_channel_service_desc) + enableLights(false) + enableVibration(false) + setShowBadge(false) } notificationManager.createNotificationChannel(channel) }