Prevent double notification sound when using biometrics

This commit is contained in:
M66B 2019-07-11 10:14:51 +02:00
parent 1e7949a982
commit c3b7275a48
1 changed files with 4 additions and 1 deletions

View File

@ -1854,6 +1854,7 @@ class Core {
final List<Long> add = new ArrayList<>();
final List<Long> remove = groupNotifying.get(group);
int updates = 0;
for (Notification notification : notifications) {
Long id = notification.extras.getLong("id", 0);
if (id != 0)
@ -1863,6 +1864,8 @@ class Core {
} else {
remove.remove(-id);
add.add(id);
if (biometrics && groupNotifying.get(group).contains(-id))
updates++;
Log.i("Notify adding=" + id);
}
}
@ -1884,7 +1887,7 @@ class Core {
for (Notification notification : notifications) {
long id = notification.extras.getLong("id", 0);
if ((id == 0 && add.size() + remove.size() > 0) || (add.contains(id) && !biometrics)) {
if ((id == 0 && add.size() + remove.size() - updates > 0) || (add.contains(id) && !biometrics)) {
String tag = "unseen." + group + "." + Math.abs(id);
Log.i("Notifying tag=" + tag +
(Build.VERSION.SDK_INT < Build.VERSION_CODES.O ? "" : " channel=" + notification.getChannelId()));