From d062974f5503fe0e6fee34536965ac054881e991 Mon Sep 17 00:00:00 2001 From: M66B Date: Fri, 5 Apr 2019 08:20:26 +0200 Subject: [PATCH] Require battery not low for cleanup --- app/src/main/java/eu/faircode/email/WorkerCleanup.java | 1 + 1 file changed, 1 insertion(+) diff --git a/app/src/main/java/eu/faircode/email/WorkerCleanup.java b/app/src/main/java/eu/faircode/email/WorkerCleanup.java index 5a3f34c946..68accd0b86 100644 --- a/app/src/main/java/eu/faircode/email/WorkerCleanup.java +++ b/app/src/main/java/eu/faircode/email/WorkerCleanup.java @@ -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)