mirror of https://github.com/M66B/FairEmail.git
Added reset
This commit is contained in:
parent
8cf35e8499
commit
670079f6e2
|
@ -253,7 +253,7 @@ public class ActivityView extends ActivityBilling implements FragmentManager.OnB
|
|||
onShowLog();
|
||||
break;
|
||||
case R.string.menu_setup:
|
||||
onReload();
|
||||
onReset();
|
||||
break;
|
||||
case R.string.menu_faq:
|
||||
onDebugInfo();
|
||||
|
@ -1068,8 +1068,8 @@ public class ActivityView extends ActivityBilling implements FragmentManager.OnB
|
|||
Helper.view(this, this, getIntentOtherApps());
|
||||
}
|
||||
|
||||
private void onReload() {
|
||||
ServiceSynchronize.reload(this, "manual reload");
|
||||
private void onReset() {
|
||||
ServiceSynchronize.reset(this);
|
||||
}
|
||||
|
||||
private void onDebugInfo() {
|
||||
|
|
|
@ -204,6 +204,11 @@ public class ServiceSynchronize extends LifecycleService {
|
|||
onReload(intent.getStringExtra("reason"));
|
||||
break;
|
||||
|
||||
case "reset":
|
||||
lastLost = 0;
|
||||
onReload("reset");
|
||||
break;
|
||||
|
||||
case "oneshot_start":
|
||||
onOneshot(true);
|
||||
break;
|
||||
|
@ -1277,6 +1282,12 @@ public class ServiceSynchronize extends LifecycleService {
|
|||
.putExtra("reason", reason));
|
||||
}
|
||||
|
||||
static void reset(Context context) {
|
||||
ContextCompat.startForegroundService(context,
|
||||
new Intent(context, ServiceSynchronize.class)
|
||||
.setAction("reset"));
|
||||
}
|
||||
|
||||
static void process(Context context) {
|
||||
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
|
||||
boolean enabled = prefs.getBoolean("enabled", true);
|
||||
|
|
Loading…
Reference in New Issue