Added logging

This commit is contained in:
M66B 2019-05-07 20:47:40 +02:00
parent 8b29ea888a
commit 7b277737f5
1 changed files with 16 additions and 6 deletions

View File

@ -1688,16 +1688,26 @@ class Core {
" added=" + add.size() + " removed=" + remove.size() + " headers=" + headers);
if (notifications.size() == 0 ||
(Build.VERSION.SDK_INT < Build.VERSION_CODES.O && headers > 0))
nm.cancel("unseen." + group + ":0", 1);
(Build.VERSION.SDK_INT < Build.VERSION_CODES.O && headers > 0)) {
String tag = "unseen." + group + ":0";
Log.i("Cancelling tag=" + tag);
nm.cancel(tag, 1);
}
for (Long id : remove)
nm.cancel("unseen." + group + ":" + Math.abs(id), 1);
for (Long id : remove) {
String tag = "unseen." + group + ":" + Math.abs(id);
Log.i("Cancelling tag=" + tag);
nm.cancel(tag, 1);
}
for (Notification notification : notifications) {
long id = notification.extras.getLong("id", 0);
if ((id == 0 && add.size() + remove.size() > 0) || add.contains(id))
nm.notify("unseen." + group + ":" + Math.abs(id), 1, notification);
if ((id == 0 && add.size() + remove.size() > 0) || add.contains(id)) {
String tag = "unseen." + group + ":" + Math.abs(id);
Log.i("Notifying tag=" + tag +
(Build.VERSION.SDK_INT < Build.VERSION_CODES.O ? "" : " channel=" + notification.getChannelId()));
nm.notify(tag, 1, notification);
}
}
if (all.size() > 0)