diff --git a/app/src/main/java/eu/faircode/email/ApplicationEx.java b/app/src/main/java/eu/faircode/email/ApplicationEx.java index 7f196686d8..03e1a1d769 100644 --- a/app/src/main/java/eu/faircode/email/ApplicationEx.java +++ b/app/src/main/java/eu/faircode/email/ApplicationEx.java @@ -1110,6 +1110,11 @@ public class ApplicationEx extends Application if (version < 2283) editor.remove("cert_transparency"); + if (version < 2296) { + if (!prefs.contains("badge")) + editor.putBoolean("badge", true); + } + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O && !BuildConfig.DEBUG) editor.remove("background_service"); diff --git a/app/src/main/java/eu/faircode/email/FragmentOptionsNotifications.java b/app/src/main/java/eu/faircode/email/FragmentOptionsNotifications.java index fc121210d1..a85329f6ae 100644 --- a/app/src/main/java/eu/faircode/email/FragmentOptionsNotifications.java +++ b/app/src/main/java/eu/faircode/email/FragmentOptionsNotifications.java @@ -917,7 +917,7 @@ public class FragmentOptionsNotifications extends FragmentBase implements Shared swLight.setChecked(prefs.getBoolean("light", false)); swNotifyScreenOn.setChecked(prefs.getBoolean("notify_screen_on", false)); - swBadge.setChecked(prefs.getBoolean("badge", true)); + swBadge.setChecked(prefs.getBoolean("badge", Build.VERSION.SDK_INT < Build.VERSION_CODES.VANILLA_ICE_CREAM)); swUnseenIgnored.setChecked(prefs.getBoolean("unseen_ignored", false)); swNotifyGrouping.setChecked(prefs.getBoolean("notify_grouping", true)); swNotifyPrivate.setChecked(prefs.getBoolean("notify_private", true)); diff --git a/app/src/main/java/eu/faircode/email/NotificationHelper.java b/app/src/main/java/eu/faircode/email/NotificationHelper.java index 64de203a88..a7b83e7bc9 100644 --- a/app/src/main/java/eu/faircode/email/NotificationHelper.java +++ b/app/src/main/java/eu/faircode/email/NotificationHelper.java @@ -379,7 +379,7 @@ class NotificationHelper { DB db = DB.getInstance(context); SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context); - boolean badge = prefs.getBoolean("badge", true); + boolean badge = prefs.getBoolean("badge", Build.VERSION.SDK_INT < Build.VERSION_CODES.VANILLA_ICE_CREAM); boolean notify_background_only = prefs.getBoolean("notify_background_only", false); boolean notify_summary = prefs.getBoolean("notify_summary", false); boolean notify_preview = prefs.getBoolean("notify_preview", true); diff --git a/app/src/main/java/eu/faircode/email/ServiceSynchronize.java b/app/src/main/java/eu/faircode/email/ServiceSynchronize.java index 89bc066735..98018e37a4 100644 --- a/app/src/main/java/eu/faircode/email/ServiceSynchronize.java +++ b/app/src/main/java/eu/faircode/email/ServiceSynchronize.java @@ -985,7 +985,7 @@ public class ServiceSynchronize extends ServiceBase implements SharedPreferences Widget.update(ServiceSynchronize.this); - boolean badge = prefs.getBoolean("badge", true); + boolean badge = prefs.getBoolean("badge", Build.VERSION.SDK_INT < Build.VERSION_CODES.VANILLA_ICE_CREAM); boolean unseen_ignored = prefs.getBoolean("unseen_ignored", false); int count = 0; @@ -2349,7 +2349,8 @@ public class ServiceSynchronize extends ServiceBase implements SharedPreferences try { ifolder = iservice.getStore().getFolder(folder.name); - } catch (IllegalStateException | MessagingException ex) { + } catch (IllegalStateException | + MessagingException ex) { if ("Not connected".equals(ex.getMessage())) { Log.i(ex); return; // Store closed