Debug: run daily

This commit is contained in:
M66B
2022-12-24 11:00:50 +01:00
parent 34c878c7ec
commit fc2ab4542e
8 changed files with 60 additions and 17 deletions

View File

@@ -172,6 +172,7 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
private SwitchCompat swTest5;
private Button btnRepair;
private Button btnDaily;
private SwitchCompat swAutostart;
private SwitchCompat swWorkManager;
private SwitchCompat swExternalStorage;
@@ -385,6 +386,7 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
swTest5 = view.findViewById(R.id.swTest5);
btnRepair = view.findViewById(R.id.btnRepair);
btnDaily = view.findViewById(R.id.btnDaily);
swAutostart = view.findViewById(R.id.swAutostart);
swWorkManager = view.findViewById(R.id.swWorkManager);
swExternalStorage = view.findViewById(R.id.swExternalStorage);
@@ -1146,6 +1148,24 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
});
btnDaily.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
new SimpleTask<Void>() {
@Override
protected Void onExecute(Context context, Bundle args) throws Throwable {
WorkerDailyRules.daily(context);
return null;
}
@Override
protected void onException(Bundle args, Throwable ex) {
Log.unexpectedError(getParentFragmentManager(), ex);
}
}.execute(FragmentOptionsMisc.this, new Bundle(), "daily");
}
});
swAutostart.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton v, boolean checked) {