From 172e9df5e3d182aec160ed28c7bcc3c2e2f24344 Mon Sep 17 00:00:00 2001 From: M66B Date: Tue, 26 Jan 2021 19:59:40 +0100 Subject: [PATCH] Skip showing zero accounts --- app/src/main/java/eu/faircode/email/ServiceSynchronize.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/ServiceSynchronize.java b/app/src/main/java/eu/faircode/email/ServiceSynchronize.java index 5696e03b4c..8bc94a0a28 100644 --- a/app/src/main/java/eu/faircode/email/ServiceSynchronize.java +++ b/app/src/main/java/eu/faircode/email/ServiceSynchronize.java @@ -929,8 +929,6 @@ public class ServiceSynchronize extends ServiceBase implements SharedPreferences NotificationCompat.Builder builder = new NotificationCompat.Builder(this, "service") .setSmallIcon(R.drawable.baseline_compare_arrows_white_24) - .setContentTitle(getResources().getQuantityString( - R.plurals.title_notification_synchronizing, lastAccounts, lastAccounts)) .setContentIntent(piWhy) .setAutoCancel(false) .setShowWhen(false) @@ -940,6 +938,10 @@ public class ServiceSynchronize extends ServiceBase implements SharedPreferences .setVisibility(NotificationCompat.VISIBILITY_SECRET) .setLocalOnly(true); + if (lastAccounts > 0) + builder.setContentTitle(getResources().getQuantityString( + R.plurals.title_notification_synchronizing, lastAccounts, lastAccounts)); + if (lastOperations > 0) builder.setContentText(getResources().getQuantityString( R.plurals.title_notification_operations, lastOperations, lastOperations));