mirror of
https://github.com/M66B/FairEmail.git
synced 2025-01-01 04:35:57 +00:00
Removed work constraints
This commit is contained in:
parent
19c2da1773
commit
1e7a11da91
2 changed files with 0 additions and 12 deletions
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue