|
|
@ -19,7 +19,6 @@ package eu.faircode.email;
|
|
|
|
Copyright 2018-2025 by Marcel Bokhorst (M66B)
|
|
|
|
Copyright 2018-2025 by Marcel Bokhorst (M66B)
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
import static androidx.core.app.NotificationCompat.DEFAULT_LIGHTS;
|
|
|
|
|
|
|
|
import static androidx.core.app.NotificationCompat.DEFAULT_SOUND;
|
|
|
|
import static androidx.core.app.NotificationCompat.DEFAULT_SOUND;
|
|
|
|
|
|
|
|
|
|
|
|
import android.Manifest;
|
|
|
|
import android.Manifest;
|
|
|
@ -819,9 +818,11 @@ class NotificationHelper {
|
|
|
|
if (notify_summary) {
|
|
|
|
if (notify_summary) {
|
|
|
|
builder.setOnlyAlertOnce(new_messages <= 0);
|
|
|
|
builder.setOnlyAlertOnce(new_messages <= 0);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (light)
|
|
|
|
|
|
|
|
setLight(builder);
|
|
|
|
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.O)
|
|
|
|
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.O)
|
|
|
|
if (new_messages > 0)
|
|
|
|
if (new_messages > 0)
|
|
|
|
setLightAndSound(builder, light, sound);
|
|
|
|
setSound(builder, sound);
|
|
|
|
else
|
|
|
|
else
|
|
|
|
builder.setSound(null);
|
|
|
|
builder.setSound(null);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
@ -1015,8 +1016,10 @@ class NotificationHelper {
|
|
|
|
.setGroupSummary(false)
|
|
|
|
.setGroupSummary(false)
|
|
|
|
.setGroupAlertBehavior(NotificationCompat.GROUP_ALERT_CHILDREN);
|
|
|
|
.setGroupAlertBehavior(NotificationCompat.GROUP_ALERT_CHILDREN);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (light)
|
|
|
|
|
|
|
|
setLight(mbuilder);
|
|
|
|
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.O)
|
|
|
|
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.O)
|
|
|
|
setLightAndSound(mbuilder, light, sound);
|
|
|
|
setSound(mbuilder, sound);
|
|
|
|
|
|
|
|
|
|
|
|
Address[] afrom = messageFrom.get(message.id);
|
|
|
|
Address[] afrom = messageFrom.get(message.id);
|
|
|
|
String from = MessageHelper.formatAddresses(afrom, email_format, false);
|
|
|
|
String from = MessageHelper.formatAddresses(afrom, email_format, false);
|
|
|
@ -1380,13 +1383,13 @@ class NotificationHelper {
|
|
|
|
return message.accountColor;
|
|
|
|
return message.accountColor;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private static void setLightAndSound(NotificationCompat.Builder builder, boolean light, String sound) {
|
|
|
|
private static void setLight(NotificationCompat.Builder builder) {
|
|
|
|
int def = 0;
|
|
|
|
builder.setLights(Color.YELLOW, 500, 500);
|
|
|
|
|
|
|
|
Log.i("Notify light enabled");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (light) {
|
|
|
|
private static void setSound(NotificationCompat.Builder builder, String sound) {
|
|
|
|
def |= DEFAULT_LIGHTS;
|
|
|
|
int def = 0;
|
|
|
|
Log.i("Notify light enabled");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!"".equals(sound)) {
|
|
|
|
if (!"".equals(sound)) {
|
|
|
|
// Not silent sound
|
|
|
|
// Not silent sound
|
|
|
|