Added reset

pull/153/head
M66B 6 years ago
parent 8cf35e8499
commit 670079f6e2

@ -253,7 +253,7 @@ public class ActivityView extends ActivityBilling implements FragmentManager.OnB
onShowLog(); onShowLog();
break; break;
case R.string.menu_setup: case R.string.menu_setup:
onReload(); onReset();
break; break;
case R.string.menu_faq: case R.string.menu_faq:
onDebugInfo(); onDebugInfo();
@ -1068,8 +1068,8 @@ public class ActivityView extends ActivityBilling implements FragmentManager.OnB
Helper.view(this, this, getIntentOtherApps()); Helper.view(this, this, getIntentOtherApps());
} }
private void onReload() { private void onReset() {
ServiceSynchronize.reload(this, "manual reload"); ServiceSynchronize.reset(this);
} }
private void onDebugInfo() { private void onDebugInfo() {

@ -204,6 +204,11 @@ public class ServiceSynchronize extends LifecycleService {
onReload(intent.getStringExtra("reason")); onReload(intent.getStringExtra("reason"));
break; break;
case "reset":
lastLost = 0;
onReload("reset");
break;
case "oneshot_start": case "oneshot_start":
onOneshot(true); onOneshot(true);
break; break;
@ -1277,6 +1282,12 @@ public class ServiceSynchronize extends LifecycleService {
.putExtra("reason", reason)); .putExtra("reason", reason));
} }
static void reset(Context context) {
ContextCompat.startForegroundService(context,
new Intent(context, ServiceSynchronize.class)
.setAction("reset"));
}
static void process(Context context) { static void process(Context context) {
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context); SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
boolean enabled = prefs.getBoolean("enabled", true); boolean enabled = prefs.getBoolean("enabled", true);

Loading…
Cancel
Save