|
|
@ -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);
|
|
|
|