Disabled badge on Android < 15

master
M66B 2 weeks ago
parent 0b99724bf5
commit 74c3c97d40

@ -1110,6 +1110,11 @@ public class ApplicationEx extends Application
if (version < 2283) if (version < 2283)
editor.remove("cert_transparency"); 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) if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O && !BuildConfig.DEBUG)
editor.remove("background_service"); editor.remove("background_service");

@ -917,7 +917,7 @@ public class FragmentOptionsNotifications extends FragmentBase implements Shared
swLight.setChecked(prefs.getBoolean("light", false)); swLight.setChecked(prefs.getBoolean("light", false));
swNotifyScreenOn.setChecked(prefs.getBoolean("notify_screen_on", 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)); swUnseenIgnored.setChecked(prefs.getBoolean("unseen_ignored", false));
swNotifyGrouping.setChecked(prefs.getBoolean("notify_grouping", true)); swNotifyGrouping.setChecked(prefs.getBoolean("notify_grouping", true));
swNotifyPrivate.setChecked(prefs.getBoolean("notify_private", true)); swNotifyPrivate.setChecked(prefs.getBoolean("notify_private", true));

@ -379,7 +379,7 @@ class NotificationHelper {
DB db = DB.getInstance(context); DB db = DB.getInstance(context);
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(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_background_only = prefs.getBoolean("notify_background_only", false);
boolean notify_summary = prefs.getBoolean("notify_summary", false); boolean notify_summary = prefs.getBoolean("notify_summary", false);
boolean notify_preview = prefs.getBoolean("notify_preview", true); boolean notify_preview = prefs.getBoolean("notify_preview", true);

@ -985,7 +985,7 @@ public class ServiceSynchronize extends ServiceBase implements SharedPreferences
Widget.update(ServiceSynchronize.this); 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); boolean unseen_ignored = prefs.getBoolean("unseen_ignored", false);
int count = 0; int count = 0;
@ -2349,7 +2349,8 @@ public class ServiceSynchronize extends ServiceBase implements SharedPreferences
try { try {
ifolder = iservice.getStore().getFolder(folder.name); ifolder = iservice.getStore().getFolder(folder.name);
} catch (IllegalStateException | MessagingException ex) { } catch (IllegalStateException |
MessagingException ex) {
if ("Not connected".equals(ex.getMessage())) { if ("Not connected".equals(ex.getMessage())) {
Log.i(ex); Log.i(ex);
return; // Store closed return; // Store closed

Loading…
Cancel
Save