From 619662602004ef0b7bf289277da4d8a2b14b531e Mon Sep 17 00:00:00 2001 From: schwma <37244550+schwma@users.noreply.github.com> Date: Thu, 8 Nov 2018 14:23:21 +0100 Subject: [PATCH] Adjust notification channel importances --- .../main/java/com/github/gotify/NotificationSupport.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/com/github/gotify/NotificationSupport.java b/app/src/main/java/com/github/gotify/NotificationSupport.java index 47d709f..b497b11 100644 --- a/app/src/main/java/com/github/gotify/NotificationSupport.java +++ b/app/src/main/java/com/github/gotify/NotificationSupport.java @@ -24,16 +24,20 @@ public class NotificationSupport { @RequiresApi(Build.VERSION_CODES.O) public static void createChannels(NotificationManager notificationManager) { try { + // Low importance so that persistent notification can be sorted towards bottom of + // notification shade. Also prevents vibrations caused by persistent notification NotificationChannel foreground = new NotificationChannel( Channel.FOREGROUND, "Gotify foreground notification", - NotificationManager.IMPORTANCE_DEFAULT); + NotificationManager.IMPORTANCE_LOW); + // High importance for message notifications so that they are shown as heads-up + // notifications and sorted towards the top of the notification shade NotificationChannel messages = new NotificationChannel( Channel.MESSAGES, "Gotify messages", - NotificationManager.IMPORTANCE_DEFAULT); + NotificationManager.IMPORTANCE_HIGH); notificationManager.createNotificationChannel(foreground); notificationManager.createNotificationChannel(messages); } catch (Exception e) {