From 6a5b3e6fb838d5d3184e0efe92f6928158a1d426 Mon Sep 17 00:00:00 2001 From: M66B Date: Thu, 5 Jan 2023 11:53:45 +0100 Subject: [PATCH] Use dedicated text executor --- app/src/main/java/eu/faircode/email/TextHelper.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/eu/faircode/email/TextHelper.java b/app/src/main/java/eu/faircode/email/TextHelper.java index 80303778f1..1ea5e39e56 100644 --- a/app/src/main/java/eu/faircode/email/TextHelper.java +++ b/app/src/main/java/eu/faircode/email/TextHelper.java @@ -47,6 +47,7 @@ import java.util.List; import java.util.Locale; import java.util.Set; import java.util.concurrent.Callable; +import java.util.concurrent.ExecutorService; import java.util.concurrent.Future; import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeoutException; @@ -66,6 +67,9 @@ public class TextHelper { private static final int MAX_CONVERSATION_SAMPLE_SIZE = 8192; private static final long MAX_CONVERSATION_DURATION = 3000; // milliseconds + private static final ExecutorService executor = + Helper.getBackgroundExecutor(0, 1, 3, "text"); + static { System.loadLibrary("fairemail"); } @@ -188,7 +192,7 @@ public class TextHelper { .setHints(hints) .build(); - Future future = Helper.getParallelExecutor().submit(new Callable() { + Future future = executor.submit(new Callable() { @Override @RequiresApi(api = Build.VERSION_CODES.Q) public ConversationActions call() throws Exception {