diff --git a/app/src/main/java/eu/faircode/email/EntityOperation.java b/app/src/main/java/eu/faircode/email/EntityOperation.java index 6aafd0a0d6..d579e0105f 100644 --- a/app/src/main/java/eu/faircode/email/EntityOperation.java +++ b/app/src/main/java/eu/faircode/email/EntityOperation.java @@ -215,7 +215,7 @@ public class EntityOperation { else if (FOREGROUND.contains(name)) { EntityAccount account = db.account().getAccount(message.account); if (account != null && !"connected".equals(account.state)) - WorkerForeground.queue(operation.folder); + WorkerOperations.queue(operation.folder); } } @@ -248,7 +248,7 @@ public class EntityOperation { if (account == null) // Outbox ServiceSend.start(context); else if (foreground && !"connected".equals(account.state)) - WorkerForeground.queue(fid); + WorkerOperations.queue(fid); Log.i("Queued sync folder=" + folder + " foreground=" + foreground); } diff --git a/app/src/main/java/eu/faircode/email/WorkerForeground.java b/app/src/main/java/eu/faircode/email/WorkerOperations.java similarity index 94% rename from app/src/main/java/eu/faircode/email/WorkerForeground.java rename to app/src/main/java/eu/faircode/email/WorkerOperations.java index 5b69b006b6..9059f89f87 100644 --- a/app/src/main/java/eu/faircode/email/WorkerForeground.java +++ b/app/src/main/java/eu/faircode/email/WorkerOperations.java @@ -22,8 +22,8 @@ import androidx.work.WorkManager; import androidx.work.Worker; import androidx.work.WorkerParameters; -public class WorkerForeground extends Worker { - public WorkerForeground(@NonNull Context context, @NonNull WorkerParameters args) { +public class WorkerOperations extends Worker { + public WorkerOperations(@NonNull Context context, @NonNull WorkerParameters args) { super(context, args); } @@ -118,13 +118,8 @@ public class WorkerForeground extends Worker { return Result.success(); } - @Override - public void onStopped() { - Log.i("Worked stopped"); - } - static void queue(long fid) { - String tag = "folder:" + fid; + String tag = "operations:" + fid; Log.i("Queuing work " + tag); try { @@ -139,7 +134,7 @@ public class WorkerForeground extends Worker { Data data = new Data.Builder().putLong("folder", fid).build(); OneTimeWorkRequest workRequest = - new OneTimeWorkRequest.Builder(WorkerForeground.class) + new OneTimeWorkRequest.Builder(WorkerOperations.class) .addTag(tag) .setInputData(data) .build();