Require battery not low for cleanup

This commit is contained in:
M66B 2019-04-05 08:20:26 +02:00
parent 255fc56b17
commit d062974f55
1 changed files with 1 additions and 0 deletions

View File

@ -170,6 +170,7 @@ public class WorkerCleanup extends Worker {
Constraints.Builder constraints = new Constraints.Builder(); Constraints.Builder constraints = new Constraints.Builder();
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M && !BuildConfig.DEBUG) if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M && !BuildConfig.DEBUG)
constraints.setRequiresDeviceIdle(true); constraints.setRequiresDeviceIdle(true);
constraints.setRequiresBatteryNotLow(true);
PeriodicWorkRequest workRequest = PeriodicWorkRequest workRequest =
new PeriodicWorkRequest.Builder(WorkerCleanup.class, CLEANUP_INTERVAL, TimeUnit.HOURS) new PeriodicWorkRequest.Builder(WorkerCleanup.class, CLEANUP_INTERVAL, TimeUnit.HOURS)