From be5692ffd76f2e3baf7d2cbfe4c8d1a78469a37d Mon Sep 17 00:00:00 2001 From: M66B Date: Tue, 18 Oct 2022 12:33:22 +0200 Subject: [PATCH] Disable auto optimize on exempting account --- .../java/eu/faircode/email/FragmentOptionsSynchronize.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/src/main/java/eu/faircode/email/FragmentOptionsSynchronize.java b/app/src/main/java/eu/faircode/email/FragmentOptionsSynchronize.java index facb4cb222..efe4bae5b8 100644 --- a/app/src/main/java/eu/faircode/email/FragmentOptionsSynchronize.java +++ b/app/src/main/java/eu/faircode/email/FragmentOptionsSynchronize.java @@ -705,6 +705,11 @@ public class FragmentOptionsSynchronize extends FragmentBase implements SharedPr long id = args.getLong("id"); boolean exempted = args.getBoolean("exempted"); + if (exempted) { + SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context); + prefs.edit().remove("auto_optimize").apply(); + } + DB db = DB.getInstance(context); db.account().setAccountPollExempted(id, exempted);