From 1e7a11da913083b7649bbbf95ce6ace8a623f625 Mon Sep 17 00:00:00 2001 From: M66B Date: Sun, 3 Mar 2019 19:23:47 +0000 Subject: [PATCH] Removed work constraints --- app/src/main/java/eu/faircode/email/WorkerFolderSync.java | 6 ------ app/src/main/java/eu/faircode/email/WorkerOperations.java | 6 ------ 2 files changed, 12 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/WorkerFolderSync.java b/app/src/main/java/eu/faircode/email/WorkerFolderSync.java index 0db910d6a4..f6a049c201 100644 --- a/app/src/main/java/eu/faircode/email/WorkerFolderSync.java +++ b/app/src/main/java/eu/faircode/email/WorkerFolderSync.java @@ -11,9 +11,7 @@ import javax.mail.Session; import javax.mail.Store; import androidx.annotation.NonNull; -import androidx.work.Constraints; import androidx.work.Data; -import androidx.work.NetworkType; import androidx.work.OneTimeWorkRequest; import androidx.work.WorkInfo; import androidx.work.WorkManager; @@ -99,14 +97,10 @@ public class WorkerFolderSync extends Worker { Log.w(ex); } - Constraints.Builder constraints = new Constraints.Builder(); - constraints.setRequiredNetworkType(NetworkType.CONNECTED); - Data data = new Data.Builder().putLong("account", aid).build(); OneTimeWorkRequest workRequest = new OneTimeWorkRequest.Builder(WorkerFolderSync.class) .addTag(tag) - .setConstraints(constraints.build()) .setInputData(data) .build(); WorkManager.getInstance().enqueue(workRequest); diff --git a/app/src/main/java/eu/faircode/email/WorkerOperations.java b/app/src/main/java/eu/faircode/email/WorkerOperations.java index 057a542ede..aaaea32d1c 100644 --- a/app/src/main/java/eu/faircode/email/WorkerOperations.java +++ b/app/src/main/java/eu/faircode/email/WorkerOperations.java @@ -14,9 +14,7 @@ import javax.mail.event.StoreEvent; import javax.mail.event.StoreListener; import androidx.annotation.NonNull; -import androidx.work.Constraints; import androidx.work.Data; -import androidx.work.NetworkType; import androidx.work.OneTimeWorkRequest; import androidx.work.WorkInfo; import androidx.work.WorkManager; @@ -133,14 +131,10 @@ public class WorkerOperations extends Worker { Log.w(ex); } - Constraints.Builder constraints = new Constraints.Builder(); - constraints.setRequiredNetworkType(NetworkType.CONNECTED); - Data data = new Data.Builder().putLong("folder", fid).build(); OneTimeWorkRequest workRequest = new OneTimeWorkRequest.Builder(WorkerOperations.class) .addTag(tag) - .setConstraints(constraints.build()) .setInputData(data) .build(); WorkManager.getInstance().enqueue(workRequest);