From 45780655626d025d59955831a7a12dba6481bd19 Mon Sep 17 00:00:00 2001 From: M66B Date: Sun, 9 Jun 2019 20:51:02 +0200 Subject: [PATCH] Added send notification channel --- .../java/eu/faircode/email/ApplicationEx.java | 16 ++++++++++------ .../main/java/eu/faircode/email/ServiceSend.java | 2 +- app/src/main/res/values/strings.xml | 1 + 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/ApplicationEx.java b/app/src/main/java/eu/faircode/email/ApplicationEx.java index 109ec2fc4c..0651ece850 100644 --- a/app/src/main/java/eu/faircode/email/ApplicationEx.java +++ b/app/src/main/java/eu/faircode/email/ApplicationEx.java @@ -281,25 +281,29 @@ public class ApplicationEx extends Application { NotificationManager nm = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); NotificationChannel service = new NotificationChannel( - "service", - getString(R.string.channel_service), + "service", getString(R.string.channel_service), NotificationManager.IMPORTANCE_MIN); service.setSound(null, Notification.AUDIO_ATTRIBUTES_DEFAULT); service.setShowBadge(false); service.setLockscreenVisibility(Notification.VISIBILITY_SECRET); nm.createNotificationChannel(service); + NotificationChannel send = new NotificationChannel( + "send", getString(R.string.channel_send), + NotificationManager.IMPORTANCE_HIGH); + send.setSound(null, Notification.AUDIO_ATTRIBUTES_DEFAULT); + send.setLockscreenVisibility(Notification.VISIBILITY_PRIVATE); + nm.createNotificationChannel(send); + NotificationChannel notification = new NotificationChannel( - "notification", - getString(R.string.channel_notification), + "notification", getString(R.string.channel_notification), NotificationManager.IMPORTANCE_HIGH); notification.setLockscreenVisibility(Notification.VISIBILITY_PRIVATE); notification.enableLights(true); nm.createNotificationChannel(notification); NotificationChannel warning = new NotificationChannel( - "warning", - getString(R.string.channel_warning), + "warning", getString(R.string.channel_warning), NotificationManager.IMPORTANCE_HIGH); warning.setLockscreenVisibility(Notification.VISIBILITY_PRIVATE); nm.createNotificationChannel(warning); diff --git a/app/src/main/java/eu/faircode/email/ServiceSend.java b/app/src/main/java/eu/faircode/email/ServiceSend.java index aa678488b4..7609fd472b 100644 --- a/app/src/main/java/eu/faircode/email/ServiceSend.java +++ b/app/src/main/java/eu/faircode/email/ServiceSend.java @@ -126,7 +126,7 @@ public class ServiceSend extends LifecycleService { PendingIntent pi = PendingIntent.getActivity( this, ActivityView.REQUEST_OUTBOX, intent, PendingIntent.FLAG_UPDATE_CURRENT); - NotificationCompat.Builder builder = new NotificationCompat.Builder(this, "service"); + NotificationCompat.Builder builder = new NotificationCompat.Builder(this, "send"); builder .setSmallIcon(R.drawable.baseline_send_24) diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 6514707181..b019d7c255 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -9,6 +9,7 @@ FairEmail is not supported on this device because bugs in Android cause crashes Service + Send Notifications Warnings Errors