From cbd972b70261437cffd94f1dd7f74d1acda9a8f0 Mon Sep 17 00:00:00 2001 From: M66B Date: Sun, 28 Jun 2020 11:23:24 +0200 Subject: [PATCH] Removed VACUUM on update --- .../eu/faircode/email/ReceiverAutoStart.java | 1 - .../java/eu/faircode/email/WorkerCleanup.java | 22 +------------------ 2 files changed, 1 insertion(+), 22 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/ReceiverAutoStart.java b/app/src/main/java/eu/faircode/email/ReceiverAutoStart.java index ac11d4ad78..44d4a7523f 100644 --- a/app/src/main/java/eu/faircode/email/ReceiverAutoStart.java +++ b/app/src/main/java/eu/faircode/email/ReceiverAutoStart.java @@ -33,7 +33,6 @@ public class ReceiverAutoStart extends BroadcastReceiver { ServiceSynchronize.boot(context); ServiceSend.boot(context); ServiceUI.boot(context); - WorkerCleanup.queueOnce(context); } } } diff --git a/app/src/main/java/eu/faircode/email/WorkerCleanup.java b/app/src/main/java/eu/faircode/email/WorkerCleanup.java index 62416d01d6..783d87a0c8 100644 --- a/app/src/main/java/eu/faircode/email/WorkerCleanup.java +++ b/app/src/main/java/eu/faircode/email/WorkerCleanup.java @@ -25,9 +25,7 @@ import android.database.Cursor; import androidx.annotation.NonNull; import androidx.preference.PreferenceManager; -import androidx.work.Data; import androidx.work.ExistingPeriodicWorkPolicy; -import androidx.work.OneTimeWorkRequest; import androidx.work.PeriodicWorkRequest; import androidx.work.WorkManager; import androidx.work.Worker; @@ -62,7 +60,7 @@ public class WorkerCleanup extends Worker { Log.i("Running " + getName()); Thread.currentThread().setPriority(THREAD_PRIORITY_BACKGROUND); - cleanup(getApplicationContext(), getInputData().getBoolean("manual", false)); + cleanup(getApplicationContext(), false); return Result.success(); } @@ -269,24 +267,6 @@ public class WorkerCleanup extends Worker { } } - static void queueOnce(Context context) { - try { - Log.i("Queuing " + getName() + " once"); - - Data data = new Data.Builder().putBoolean("manual", true).build(); - - OneTimeWorkRequest workRequest = new OneTimeWorkRequest.Builder(WorkerCleanup.class) - .setInputData(data) - .build(); - WorkManager.getInstance(context).enqueue(workRequest); - - Log.i("Queued " + getName() + " once"); - } catch (IllegalStateException ex) { - // https://issuetracker.google.com/issues/138465476 - Log.w(ex); - } - } - static void cancel(Context context) { try { Log.i("Cancelling " + getName());