Revert "Switch to alarm manager for more control over polling"

This reverts commit 7658047300.
This commit is contained in:
M66B
2020-01-10 12:08:14 +01:00
parent 7658047300
commit 9306d4e1e9
6 changed files with 150 additions and 75 deletions

View File

@@ -90,7 +90,7 @@ public class ServiceExternal extends Service {
public void run() {
if (accountName == null) {
if (enabled == null)
ServiceSynchronize.poll(context, null);
WorkerPoll.sync(context, null);
else {
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
prefs.edit().putBoolean("enabled", enabled).apply();
@@ -106,7 +106,7 @@ public class ServiceExternal extends Service {
}
if (enabled == null)
ServiceSynchronize.poll(context, account.id);
WorkerPoll.sync(context, account.id);
else {
db.account().setAccountSynchronize(account.id, enabled);
ServiceSynchronize.eval(context, "external account=" + accountName + " enabled=" + enabled);