mirror of https://github.com/M66B/FairEmail.git
Moved manual cleanup to setup
This commit is contained in:
parent
ff34a1ec64
commit
edfe608730
|
@ -246,6 +246,12 @@ public class ActivitySetup extends ActivityBilling implements FragmentManager.On
|
||||||
drawerLayout.closeDrawer(drawerContainer);
|
drawerLayout.closeDrawer(drawerContainer);
|
||||||
onMenuPrivacy();
|
onMenuPrivacy();
|
||||||
}
|
}
|
||||||
|
}, new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
drawerLayout.closeDrawer(drawerContainer);
|
||||||
|
onCleanup();
|
||||||
|
}
|
||||||
}));
|
}));
|
||||||
|
|
||||||
menus.add(new NavMenuItem(R.drawable.baseline_info_24, R.string.menu_about, new Runnable() {
|
menus.add(new NavMenuItem(R.drawable.baseline_info_24, R.string.menu_about, new Runnable() {
|
||||||
|
@ -516,6 +522,21 @@ public class ActivitySetup extends ActivityBilling implements FragmentManager.On
|
||||||
Helper.view(this, this, Helper.getIntentPrivacy());
|
Helper.view(this, this, Helper.getIntentPrivacy());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void onCleanup() {
|
||||||
|
new SimpleTask<Void>() {
|
||||||
|
@Override
|
||||||
|
protected Void onExecute(Context context, Bundle args) {
|
||||||
|
WorkerCleanup.cleanup(context, true);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onException(Bundle args, Throwable ex) {
|
||||||
|
Helper.unexpectedError(ActivitySetup.this, ActivitySetup.this, ex);
|
||||||
|
}
|
||||||
|
}.execute(this, new Bundle(), "cleanup:run");
|
||||||
|
}
|
||||||
|
|
||||||
private void onMenuAbout() {
|
private void onMenuAbout() {
|
||||||
if (getLifecycle().getCurrentState().isAtLeast(Lifecycle.State.RESUMED))
|
if (getLifecycle().getCurrentState().isAtLeast(Lifecycle.State.RESUMED))
|
||||||
getSupportFragmentManager().popBackStack("about", FragmentManager.POP_BACK_STACK_INCLUSIVE);
|
getSupportFragmentManager().popBackStack("about", FragmentManager.POP_BACK_STACK_INCLUSIVE);
|
||||||
|
|
|
@ -309,12 +309,6 @@ public class ActivityView extends ActivityBilling implements FragmentManager.OnB
|
||||||
drawerLayout.closeDrawer(drawerContainer);
|
drawerLayout.closeDrawer(drawerContainer);
|
||||||
onMenuPrivacy();
|
onMenuPrivacy();
|
||||||
}
|
}
|
||||||
}, new Runnable() {
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
drawerLayout.closeDrawer(drawerContainer);
|
|
||||||
onCleanup();
|
|
||||||
}
|
|
||||||
}));
|
}));
|
||||||
|
|
||||||
extra.add(new NavMenuItem(R.drawable.baseline_info_24, R.string.menu_about, new Runnable() {
|
extra.add(new NavMenuItem(R.drawable.baseline_info_24, R.string.menu_about, new Runnable() {
|
||||||
|
@ -1025,21 +1019,6 @@ public class ActivityView extends ActivityBilling implements FragmentManager.OnB
|
||||||
}.execute(this, new Bundle(), "debug:info");
|
}.execute(this, new Bundle(), "debug:info");
|
||||||
}
|
}
|
||||||
|
|
||||||
private void onCleanup() {
|
|
||||||
new SimpleTask<Void>() {
|
|
||||||
@Override
|
|
||||||
protected Void onExecute(Context context, Bundle args) {
|
|
||||||
WorkerCleanup.cleanup(ActivityView.this, true);
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void onException(Bundle args, Throwable ex) {
|
|
||||||
Helper.unexpectedError(ActivityView.this, ActivityView.this, ex);
|
|
||||||
}
|
|
||||||
}.execute(this, new Bundle(), "cleanup:job");
|
|
||||||
}
|
|
||||||
|
|
||||||
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);
|
||||||
|
|
Loading…
Reference in New Issue