diff --git a/src/main/java/org/havenapp/main/ListActivity.java b/src/main/java/org/havenapp/main/ListActivity.java index 5bef658d..dc69c1d9 100644 --- a/src/main/java/org/havenapp/main/ListActivity.java +++ b/src/main/java/org/havenapp/main/ListActivity.java @@ -321,6 +321,9 @@ public boolean onOptionsItemSelected (MenuItem item) { case R.id.action_test_notification: testNotifications(); break; + case R.id.action_run_cleanup_job: + runCleanUpJob(); + break; } return true; } @@ -337,6 +340,10 @@ private void removeAllEvents() new EventDeleteAllAsync(() -> onAllEventsRemoved(removedEvents)).execute(removedEvents); } + private void runCleanUpJob() { + RemoveDeletedFilesJob.Companion.runNow(); + } + private void onAllEventsRemoved(List removedEvents) { Snackbar.make(recyclerView, resourceManager.getString(R.string.events_deleted), Snackbar.LENGTH_SHORT) .setAction(resourceManager.getString(R.string.undo), diff --git a/src/main/java/org/havenapp/main/service/RemoveDeletedFilesJob.kt b/src/main/java/org/havenapp/main/service/RemoveDeletedFilesJob.kt index 58f9b65e..c0d69078 100644 --- a/src/main/java/org/havenapp/main/service/RemoveDeletedFilesJob.kt +++ b/src/main/java/org/havenapp/main/service/RemoveDeletedFilesJob.kt @@ -28,6 +28,13 @@ class RemoveDeletedFilesJob: Job() { .build() .schedule() } + + fun runNow(): Int { + return JobRequest.Builder(SERVICE_TAG) + .startNow() + .build() + .schedule() + } } override fun onRunJob(params: Params): Result { diff --git a/src/main/res/menu/menu_main.xml b/src/main/res/menu/menu_main.xml index 32c9caa3..b31f12a1 100644 --- a/src/main/res/menu/menu_main.xml +++ b/src/main/res/menu/menu_main.xml @@ -24,6 +24,13 @@ android:orderInCategory="100" android:title="@string/menu_licenses" app:showAsAction="never" /> + + + Recording... LIGHT DETECTED + Clean deleted logs from disk