From ddb23099b57fbefcc7d1c08505f2667711036cd5 Mon Sep 17 00:00:00 2001 From: M66B Date: Thu, 11 Feb 2021 13:05:03 +0100 Subject: [PATCH] MIUI sound workaround for sending --- app/src/main/java/eu/faircode/email/ServiceSend.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/eu/faircode/email/ServiceSend.java b/app/src/main/java/eu/faircode/email/ServiceSend.java index a0b44a698f..dff6f0e1b7 100644 --- a/app/src/main/java/eu/faircode/email/ServiceSend.java +++ b/app/src/main/java/eu/faircode/email/ServiceSend.java @@ -198,6 +198,9 @@ public class ServiceSend extends ServiceBase implements SharedPreferences.OnShar } NotificationCompat.Builder getNotificationService() { + SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this); + boolean alert_once = prefs.getBoolean("alert_once", true); + NotificationCompat.Builder builder = new NotificationCompat.Builder(this, "send") .setSmallIcon(R.drawable.baseline_send_white_24) @@ -205,7 +208,7 @@ public class ServiceSend extends ServiceBase implements SharedPreferences.OnShar .setContentIntent(getPendingIntent(this)) .setAutoCancel(false) .setShowWhen(true) - .setOnlyAlertOnce(true) + .setOnlyAlertOnce(alert_once) .setDefaults(0) // disable sound on pre Android 8 .setLocalOnly(true) .setPriority(NotificationCompat.PRIORITY_MIN)