Unified executor model

This commit is contained in:
M66B
2022-12-13 10:52:39 +01:00
parent 101371854b
commit 6988d4c552
33 changed files with 147 additions and 297 deletions

View File

@@ -58,7 +58,6 @@ import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Properties;
import java.util.concurrent.ExecutorService;
import javax.mail.Address;
import javax.mail.AuthenticationFailedException;
@@ -84,8 +83,6 @@ public class ServiceSend extends ServiceBase implements SharedPreferences.OnShar
private PowerManager.WakeLock wlOutbox;
private List<Long> handling = new ArrayList<>();
private static final ExecutorService executor = Helper.getBackgroundExecutor(1, "send");
private static final int RETRY_MAX = 3;
private static final int CONNECTIVITY_DELAY = 5000; // milliseconds
private static final int PROGRESS_UPDATE_INTERVAL = 1000; // milliseconds
@@ -149,7 +146,7 @@ public class ServiceSend extends ServiceBase implements SharedPreferences.OnShar
"Send process=" + TextUtils.join(",", process) +
" handling=" + TextUtils.join(",", handling));
executor.submit(new Runnable() {
Helper.getSerialExecutor().submit(new Runnable() {
@Override
public void run() {
processOperations(process);
@@ -900,7 +897,7 @@ public class ServiceSend extends ServiceBase implements SharedPreferences.OnShar
}
static void boot(final Context context) {
executor.submit(new Runnable() {
Helper.getSerialExecutor().submit(new Runnable() {
@Override
public void run() {
try {