|
|
@ -105,7 +105,8 @@ public class ServiceSynchronize extends ServiceBase implements SharedPreferences
|
|
|
|
|
|
|
|
|
|
|
|
private static final long YIELD_DURATION = 200L; // milliseconds
|
|
|
|
private static final long YIELD_DURATION = 200L; // milliseconds
|
|
|
|
private static final long QUIT_DELAY = 5 * 1000L; // milliseconds
|
|
|
|
private static final long QUIT_DELAY = 5 * 1000L; // milliseconds
|
|
|
|
private static final long STILL_THERE_DELAY = 3 * 60 * 1000L; // milliseconds
|
|
|
|
private static final long STILL_THERE_THRESHOLD = 3 * 60 * 1000L; // milliseconds
|
|
|
|
|
|
|
|
private static final int STILL_THERE_POLL_INTERVAL = 15; // minutes
|
|
|
|
private static final int CONNECT_BACKOFF_START = 8; // seconds
|
|
|
|
private static final int CONNECT_BACKOFF_START = 8; // seconds
|
|
|
|
private static final int CONNECT_BACKOFF_MAX = 64; // seconds (totally 2 minutes)
|
|
|
|
private static final int CONNECT_BACKOFF_MAX = 64; // seconds (totally 2 minutes)
|
|
|
|
private static final int CONNECT_BACKOFF_AlARM_START = 15; // minutes
|
|
|
|
private static final int CONNECT_BACKOFF_AlARM_START = 15; // minutes
|
|
|
@ -825,7 +826,7 @@ public class ServiceSynchronize extends ServiceBase implements SharedPreferences
|
|
|
|
|
|
|
|
|
|
|
|
if ("Still here".equals(message) && !account.ondemand) {
|
|
|
|
if ("Still here".equals(message) && !account.ondemand) {
|
|
|
|
long now = new Date().getTime();
|
|
|
|
long now = new Date().getTime();
|
|
|
|
if (now - start > STILL_THERE_DELAY)
|
|
|
|
if (now - start > STILL_THERE_THRESHOLD)
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
|
|
boolean auto_optimize = prefs.getBoolean("auto_optimize", true);
|
|
|
|
boolean auto_optimize = prefs.getBoolean("auto_optimize", true);
|
|
|
@ -834,7 +835,7 @@ public class ServiceSynchronize extends ServiceBase implements SharedPreferences
|
|
|
|
|
|
|
|
|
|
|
|
int pollInterval = prefs.getInt("poll_interval", 0);
|
|
|
|
int pollInterval = prefs.getInt("poll_interval", 0);
|
|
|
|
if (pollInterval == 0) {
|
|
|
|
if (pollInterval == 0) {
|
|
|
|
prefs.edit().putInt("poll_interval", 30).apply();
|
|
|
|
prefs.edit().putInt("poll_interval", STILL_THERE_POLL_INTERVAL).apply();
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
db.beginTransaction();
|
|
|
|
db.beginTransaction();
|
|
|
|
for (EntityAccount a : db.account().getAccounts())
|
|
|
|
for (EntityAccount a : db.account().getAccounts())
|
|
|
|