mirror of https://github.com/M66B/FairEmail.git
Allow manual cleanup
This commit is contained in:
parent
2ea38acdb7
commit
60a76298fb
|
@ -233,6 +233,9 @@ public class ActivityView extends ActivityBilling implements FragmentManager.OnB
|
||||||
case R.string.menu_faq:
|
case R.string.menu_faq:
|
||||||
onDebugInfo();
|
onDebugInfo();
|
||||||
return true;
|
return true;
|
||||||
|
case R.string.menu_privacy:
|
||||||
|
onCleanup();
|
||||||
|
return true;
|
||||||
case R.string.menu_about:
|
case R.string.menu_about:
|
||||||
onShowLog();
|
onShowLog();
|
||||||
return true;
|
return true;
|
||||||
|
@ -1020,6 +1023,21 @@ public class ActivityView extends ActivityBilling implements FragmentManager.OnB
|
||||||
}.load(this, new Bundle());
|
}.load(this, new Bundle());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void onCleanup() {
|
||||||
|
new SimpleTask<Void>() {
|
||||||
|
@Override
|
||||||
|
protected Void onLoad(Context context, Bundle args) throws Throwable {
|
||||||
|
JobDaily.cleanup(ActivityView.this);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onException(Bundle args, Throwable ex) {
|
||||||
|
Helper.unexpectedError(ActivityView.this, ActivityView.this, ex);
|
||||||
|
}
|
||||||
|
}.load(this, new Bundle());
|
||||||
|
}
|
||||||
|
|
||||||
private void onShowLog() {
|
private void onShowLog() {
|
||||||
if (getLifecycle().getCurrentState().isAtLeast(Lifecycle.State.RESUMED))
|
if (getLifecycle().getCurrentState().isAtLeast(Lifecycle.State.RESUMED))
|
||||||
getSupportFragmentManager().popBackStack("logs", FragmentManager.POP_BACK_STACK_INCLUSIVE);
|
getSupportFragmentManager().popBackStack("logs", FragmentManager.POP_BACK_STACK_INCLUSIVE);
|
||||||
|
|
|
@ -90,7 +90,8 @@ public class JobDaily extends JobService {
|
||||||
keep_time = 0;
|
keep_time = 0;
|
||||||
|
|
||||||
int messages = db.message().deleteMessagesBefore(folder.id, keep_time, false);
|
int messages = db.message().deleteMessagesBefore(folder.id, keep_time, false);
|
||||||
Log.i(Helper.TAG, "Cleanup folder=" + folder.account + ":" + folder.name +
|
if (messages > 0)
|
||||||
|
Log.i(Helper.TAG, "Cleanup folder=" + folder.account + "/" + folder.name +
|
||||||
" before=" + new Date(keep_time) + " deleted=" + messages);
|
" before=" + new Date(keep_time) + " deleted=" + messages);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue