diff --git a/app/src/main/java/eu/faircode/email/FragmentFolders.java b/app/src/main/java/eu/faircode/email/FragmentFolders.java index 4cffd7ae9c..0fb220c177 100644 --- a/app/src/main/java/eu/faircode/email/FragmentFolders.java +++ b/app/src/main/java/eu/faircode/email/FragmentFolders.java @@ -1048,7 +1048,7 @@ public class FragmentFolders extends FragmentBase { new SimpleTask() { @Override protected Void onExecute(Context context, Bundle args) throws Throwable { - long account = args.getLong("account"); + long aid = args.getLong("account"); Boolean enable = null; if (args.containsKey("enable")) enable = args.getBoolean("enable"); @@ -1066,7 +1066,14 @@ public class FragmentFolders extends FragmentBase { try { db.beginTransaction(); - List folders = db.folder().getFolders(account, false, true); + EntityAccount account = db.account().getAccount(aid); + if (account == null) + return null; + + if (system && account.poll_interval > 15) + db.account().setAccountKeepAliveInterval(account.id, 15); + + List folders = db.folder().getFolders(aid, false, true); if (folders == null) return null; @@ -1095,7 +1102,7 @@ public class FragmentFolders extends FragmentBase { db.endTransaction(); } - ServiceSynchronize.reload(context, account, false, "Apply"); + ServiceSynchronize.reload(context, aid, false, "Apply"); return null; }