Keep alive via the watchdog

pull/197/head
M66B 5 years ago
parent 5a79409ed3
commit 7b5d25b56c

@ -115,7 +115,7 @@ public class ActivityMain extends ActivityBase implements FragmentManager.OnBack
getMainHandler().postDelayed(new Runnable() { getMainHandler().postDelayed(new Runnable() {
@Override @Override
public void run() { public void run() {
ServiceSynchronize.eval(ActivityMain.this, "main"); ServiceSynchronize.watchdog(ActivityMain.this);
ServiceSend.watchdog(ActivityMain.this); ServiceSend.watchdog(ActivityMain.this);
} }
}, SERVICE_START_DELAY); }, SERVICE_START_DELAY);

@ -174,15 +174,10 @@ public class ApplicationEx extends Application
DisconnectBlacklist.init(this); DisconnectBlacklist.init(this);
boolean watchdog = prefs.getBoolean("watchdog", true);
boolean enabled = prefs.getBoolean("enabled", true);
if (watchdog && enabled)
WorkerWatchdog.init(this);
else {
ServiceSynchronize.watchdog(this); ServiceSynchronize.watchdog(this);
ServiceSend.watchdog(this); ServiceSend.watchdog(this);
}
WorkerWatchdog.init(this);
WorkerCleanup.init(this); WorkerCleanup.init(this);
registerReceiver(onScreenOff, new IntentFilter(Intent.ACTION_SCREEN_OFF)); registerReceiver(onScreenOff, new IntentFilter(Intent.ACTION_SCREEN_OFF));

@ -2502,9 +2502,6 @@ public class ServiceSynchronize extends ServiceBase implements SharedPreferences
} }
static void watchdog(Context context) { static void watchdog(Context context) {
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
boolean enabled = prefs.getBoolean("enabled", true);
if (enabled)
start(context, start(context,
new Intent(context, ServiceSynchronize.class) new Intent(context, ServiceSynchronize.class)
.setAction("watchdog")); .setAction("watchdog"));

Loading…
Cancel
Save