mirror of https://github.com/M66B/FairEmail.git
Require battery not low for cleanup
This commit is contained in:
parent
255fc56b17
commit
d062974f55
|
@ -170,6 +170,7 @@ public class WorkerCleanup extends Worker {
|
|||
Constraints.Builder constraints = new Constraints.Builder();
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M && !BuildConfig.DEBUG)
|
||||
constraints.setRequiresDeviceIdle(true);
|
||||
constraints.setRequiresBatteryNotLow(true);
|
||||
|
||||
PeriodicWorkRequest workRequest =
|
||||
new PeriodicWorkRequest.Builder(WorkerCleanup.class, CLEANUP_INTERVAL, TimeUnit.HOURS)
|
||||
|
|
Loading…
Reference in New Issue