From 9ceab0d08e8ef399a5d0cce1e2fda6c68db6afb4 Mon Sep 17 00:00:00 2001 From: M66B Date: Fri, 23 Apr 2021 17:08:57 +0200 Subject: [PATCH] Serialize decrypt actions --- app/src/main/java/eu/faircode/email/FragmentMessages.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/FragmentMessages.java b/app/src/main/java/eu/faircode/email/FragmentMessages.java index f064cf7a9f..5b7d2ddcf8 100644 --- a/app/src/main/java/eu/faircode/email/FragmentMessages.java +++ b/app/src/main/java/eu/faircode/email/FragmentMessages.java @@ -375,6 +375,8 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences. "time", "unread", "starred", "priority" )); + private static ExecutorService executor = Helper.getBackgroundExecutor(1, "decrypt"); + @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); @@ -6496,7 +6498,7 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences. } else Log.unexpectedError(getParentFragmentManager(), ex); } - }.execute(this, args, "decrypt:pgp"); + }.setExecutor(executor).execute(this, args, "decrypt:pgp"); } private void onSmime(Bundle args) { @@ -7071,7 +7073,7 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences. } return trace; } - }.execute(this, args, "decrypt:s/mime"); + }.setExecutor(executor).execute(this, args, "decrypt:s/mime"); } private static void checkPep(EntityMessage message, List remotes, Context context) {