Added auto optimize setting

This commit is contained in:
M66B
2020-02-22 17:13:14 +01:00
parent d0032d2d5d
commit 341701ff3f
4 changed files with 29 additions and 2 deletions

View File

@@ -828,6 +828,10 @@ public class ServiceSynchronize extends ServiceBase implements SharedPreferences
if (now - start > STILL_THERE_DELAY)
return;
boolean auto_optimize = prefs.getBoolean("auto_optimize", true);
if (!auto_optimize)
return;
int pollInterval = prefs.getInt("poll_interval", 0);
if (pollInterval == 0) {
prefs.edit().putInt("poll_interval", 30).apply();