diff --git a/app/src/main/java/eu/faircode/email/Core.java b/app/src/main/java/eu/faircode/email/Core.java index cd9b8313be..1729baae20 100644 --- a/app/src/main/java/eu/faircode/email/Core.java +++ b/app/src/main/java/eu/faircode/email/Core.java @@ -3973,6 +3973,7 @@ class Core { } // Difference + boolean flash = false; for (long group : groupMessages.keySet()) { List add = new ArrayList<>(); List update = new ArrayList<>(); @@ -4001,8 +4002,10 @@ class Core { update.add(id); } remove.remove(-id); - } else + } else { + flash = true; add.add(id); + } Log.i("Notify adding=" + id + " existing=" + existing); } } @@ -4083,15 +4086,15 @@ class Core { } } } + } - if (notify_screen_on && notifications.size() > 0) { - Log.i("Notify screen on"); - PowerManager pm = (PowerManager) context.getSystemService(Context.POWER_SERVICE); - PowerManager.WakeLock wakeLock = pm.newWakeLock( - PowerManager.FULL_WAKE_LOCK | PowerManager.ACQUIRE_CAUSES_WAKEUP, - BuildConfig.APPLICATION_ID + ":notification"); - wakeLock.acquire(SCREEN_ON_DURATION); - } + if (notify_screen_on && flash) { + Log.i("Notify screen on"); + PowerManager pm = (PowerManager) context.getSystemService(Context.POWER_SERVICE); + PowerManager.WakeLock wakeLock = pm.newWakeLock( + PowerManager.FULL_WAKE_LOCK | PowerManager.ACQUIRE_CAUSES_WAKEUP, + BuildConfig.APPLICATION_ID + ":notification"); + wakeLock.acquire(SCREEN_ON_DURATION); } }