Badger logging

This commit is contained in:
M66B
2023-06-16 17:06:23 +02:00
parent 38ca55c49b
commit 2fb2e054db
4 changed files with 266 additions and 6 deletions

View File

@@ -135,7 +135,7 @@ import javax.mail.search.ReceivedDateTerm;
import javax.mail.search.SearchTerm;
import javax.mail.search.SentDateTerm;
import me.leolin.shortcutbadger.ShortcutBadger;
import me.leolin.shortcutbadger.ShortcutBadgerAlt;
class Core {
static final int DEFAULT_CHUNK_SIZE = 50;
@@ -5453,7 +5453,7 @@ class Core {
nm.notify(tag, NotificationHelper.NOTIFICATION_TAGGED, notification);
// https://github.com/leolin310148/ShortcutBadger/wiki/Xiaomi-Device-Support
if (id == 0 && badge && Helper.isXiaomi())
ShortcutBadger.applyNotification(context, notification, current);
ShortcutBadgerAlt.applyNotification(context, notification, current);
} catch (Throwable ex) {
Log.w(ex);
}

View File

@@ -67,7 +67,7 @@ public class EntityLog {
public enum Type {General, Statistics, Scheduling, Network, Account, Protocol, Classification, Notification, Rules, Cloud, Debug}
static void log(final Context context, String data) {
public static void log(final Context context, String data) {
log(context, Type.General, data);
}

View File

@@ -109,7 +109,7 @@ import javax.mail.event.MessageCountEvent;
import javax.mail.event.StoreEvent;
import javax.mail.event.StoreListener;
import me.leolin.shortcutbadger.ShortcutBadger;
import me.leolin.shortcutbadger.ShortcutBadgerAlt;
public class ServiceSynchronize extends ServiceBase implements SharedPreferences.OnSharedPreferenceChangeListener {
private Network lastActive = null;
@@ -938,9 +938,9 @@ public class ServiceSynchronize extends ServiceBase implements SharedPreferences
// Update badge
try {
if (count == 0 || !badge)
ShortcutBadger.removeCount(ServiceSynchronize.this);
ShortcutBadgerAlt.removeCount(ServiceSynchronize.this);
else
ShortcutBadger.applyCount(ServiceSynchronize.this, count);
ShortcutBadgerAlt.applyCount(ServiceSynchronize.this, count);
} catch (Throwable ex) {
Log.e(ex);
}