1
0
Fork 0
mirror of https://github.com/M66B/FairEmail.git synced 2025-02-25 15:32:52 +00:00

Added send notification channel

This commit is contained in:
M66B 2019-06-09 20:51:02 +02:00
parent 2827e8abeb
commit 4578065562
3 changed files with 12 additions and 7 deletions

View file

@ -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);

View file

@ -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)

View file

@ -9,6 +9,7 @@
<string name="app_crash">FairEmail is not supported on this device because bugs in Android cause crashes</string>
<string name="channel_service">Service</string>
<string name="channel_send">Send</string>
<string name="channel_notification">Notifications</string>
<string name="channel_warning">Warnings</string>
<string name="channel_error">Errors</string>