mirror of
https://github.com/M66B/FairEmail.git
synced 2025-03-15 08:29:24 +00:00
Fixed double notification sound on older Android versions
This commit is contained in:
parent
10d6f10fde
commit
74f3d55ad9
1 changed files with 8 additions and 3 deletions
|
@ -231,14 +231,19 @@ public class ServiceSynchronize extends LifecycleService {
|
|||
}
|
||||
}
|
||||
|
||||
int headers = 0;
|
||||
for (Integer id : added)
|
||||
if (id < 0)
|
||||
headers++;
|
||||
|
||||
Log.i(Helper.TAG, "Notification account=" + account +
|
||||
" notifications=" + notifications.size() +
|
||||
" all=" + all.size() + " added=" + added.size() + " removed=" + removed.size());
|
||||
" notifications=" + notifications.size() + " all=" + all.size() +
|
||||
" added=" + added.size() + " removed=" + removed.size() + " headers=" + headers);
|
||||
|
||||
NotificationManager nm = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
|
||||
|
||||
if (notifications.size() == 0 ||
|
||||
(Build.VERSION.SDK_INT < Build.VERSION_CODES.O && added.size() > 0))
|
||||
(Build.VERSION.SDK_INT < Build.VERSION_CODES.O && headers > 0))
|
||||
nm.cancel("unseen:" + account, 0);
|
||||
|
||||
for (Integer id : removed)
|
||||
|
|
Loading…
Add table
Reference in a new issue