Require battery not low for cleanup

pull/153/head
M66B 6 years ago
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…
Cancel
Save