Badge count for Xiaomi (experimental)

This commit is contained in:
M66B 2021-05-28 20:22:47 +02:00
parent 8581afb66b
commit ef629e5329
1 changed files with 5 additions and 0 deletions

View File

@ -130,6 +130,8 @@ import javax.mail.search.ReceivedDateTerm;
import javax.mail.search.SearchTerm;
import javax.mail.search.SentDateTerm;
import me.leolin.shortcutbadger.ShortcutBadger;
import static android.os.Process.THREAD_PRIORITY_BACKGROUND;
import static androidx.core.app.NotificationCompat.DEFAULT_LIGHTS;
import static androidx.core.app.NotificationCompat.DEFAULT_SOUND;
@ -4072,6 +4074,9 @@ class Core {
" sort=" + notification.getSortKey());
try {
nm.notify(tag, 1, notification);
// https://github.com/leolin310148/ShortcutBadger/wiki/Xiaomi-Device-Support
if (id == 0 && Helper.isXiaomi())
ShortcutBadger.applyNotification(context, notification, current);
} catch (Throwable ex) {
Log.w(ex);
}