From 7b277737f5fc25e9251ea425af326753bea703c0 Mon Sep 17 00:00:00 2001 From: M66B Date: Tue, 7 May 2019 20:47:40 +0200 Subject: [PATCH] Added logging --- app/src/main/java/eu/faircode/email/Core.java | 22 ++++++++++++++----- 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/Core.java b/app/src/main/java/eu/faircode/email/Core.java index f3a0078d12..6f1f00697c 100644 --- a/app/src/main/java/eu/faircode/email/Core.java +++ b/app/src/main/java/eu/faircode/email/Core.java @@ -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)