From 66bad2312f084746b84673dc573fc1b7a833a74d Mon Sep 17 00:00:00 2001 From: M66B Date: Mon, 6 Jan 2020 12:30:14 +0100 Subject: [PATCH] Small improvement --- .../main/java/eu/faircode/email/FragmentOptionsMisc.java | 3 +++ app/src/main/java/eu/faircode/email/WorkerCleanup.java | 7 +++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/FragmentOptionsMisc.java b/app/src/main/java/eu/faircode/email/FragmentOptionsMisc.java index 1c695fee68..2ca1bb556a 100644 --- a/app/src/main/java/eu/faircode/email/FragmentOptionsMisc.java +++ b/app/src/main/java/eu/faircode/email/FragmentOptionsMisc.java @@ -277,6 +277,9 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc @Override protected Void onExecute(Context context, Bundle args) { + SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context); + prefs.edit().putBoolean("vacuum", true).apply(); + WorkerCleanup.cleanup(context, true); return null; } diff --git a/app/src/main/java/eu/faircode/email/WorkerCleanup.java b/app/src/main/java/eu/faircode/email/WorkerCleanup.java index 9b23d0b2e9..3503e420fa 100644 --- a/app/src/main/java/eu/faircode/email/WorkerCleanup.java +++ b/app/src/main/java/eu/faircode/email/WorkerCleanup.java @@ -105,12 +105,11 @@ public class WorkerCleanup extends Worker { for (EntityMessage message : db.message().getSnoozed()) EntityMessage.snooze(context, message.id, message.ui_snoozed); + ServiceSynchronize.reschedule(context); + // Clear last search SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context); - prefs.edit() - .remove("last_search") - .putBoolean("vacuum", true) - .apply(); + prefs.edit().remove("last_search").apply(); } long now = new Date().getTime();