mirror of https://github.com/M66B/FairEmail.git
Limit number of notifications to 20 per group
This commit is contained in:
parent
c6901fa9e6
commit
5b63787742
|
@ -112,6 +112,7 @@ import me.leolin.shortcutbadger.ShortcutBadger;
|
||||||
import static android.os.Process.THREAD_PRIORITY_BACKGROUND;
|
import static android.os.Process.THREAD_PRIORITY_BACKGROUND;
|
||||||
|
|
||||||
class Core {
|
class Core {
|
||||||
|
private static final int MAX_NOTIFICATION_COUNT = 20; // per group
|
||||||
private static final int SYNC_BATCH_SIZE = 20;
|
private static final int SYNC_BATCH_SIZE = 20;
|
||||||
private static final int DOWNLOAD_BATCH_SIZE = 20;
|
private static final int DOWNLOAD_BATCH_SIZE = 20;
|
||||||
private static final long YIELD_DURATION = 200L; // milliseconds
|
private static final long YIELD_DURATION = 200L; // milliseconds
|
||||||
|
@ -1776,6 +1777,7 @@ class Core {
|
||||||
Log.i("Notify existing=" + id);
|
Log.i("Notify existing=" + id);
|
||||||
} else {
|
} else {
|
||||||
remove.remove(-id);
|
remove.remove(-id);
|
||||||
|
if (add.size() < MAX_NOTIFICATION_COUNT)
|
||||||
add.add(id);
|
add.add(id);
|
||||||
Log.i("Notify adding=" + id);
|
Log.i("Notify adding=" + id);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue