From 9c0b93ab82da9b23b366a2ecf28714a9ee0ea1b6 Mon Sep 17 00:00:00 2001 From: M66B Date: Sun, 13 Mar 2022 08:15:31 +0100 Subject: [PATCH] Low priority data handler thread --- app/src/main/java/javax/activation/DataHandler.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/javax/activation/DataHandler.java b/app/src/main/java/javax/activation/DataHandler.java index 54568bdab0..7b1f5a7a9a 100644 --- a/app/src/main/java/javax/activation/DataHandler.java +++ b/app/src/main/java/javax/activation/DataHandler.java @@ -10,6 +10,8 @@ package javax.activation; +import static android.os.Process.THREAD_PRIORITY_BACKGROUND; + import com.sun.mail.imap.IMAPNestedMessage; import java.io.InputStream; @@ -265,7 +267,7 @@ public class DataHandler /*implements Transferable*/ { // final PipedOutputStream pos = new PipedOutputStream(); PipedInputStream pin = new PipedInputStream(pos); - new Thread( + Thread thread = new Thread( new Runnable() { public void run() { try { @@ -279,7 +281,9 @@ public class DataHandler /*implements Transferable*/ { } } }, - "DataHandler.getInputStream").start(); + "DataHandler.getInputStream"); + thread.setPriority(THREAD_PRIORITY_BACKGROUND); + thread.start(); ins = pin; }