|
|
|
@ -899,7 +899,7 @@ public class ServiceSynchronize extends ServiceBase implements SharedPreferences
|
|
|
|
|
try {
|
|
|
|
|
long backoff = RECONNECT_BACKOFF - ago;
|
|
|
|
|
EntityLog.log(ServiceSynchronize.this, account.name + " reconnect backoff=" + (backoff / 1000));
|
|
|
|
|
state.acquire(backoff, true);
|
|
|
|
|
state.acquire(backoff);
|
|
|
|
|
} catch (InterruptedException ex) {
|
|
|
|
|
Log.w(account.name + " backoff " + ex.toString());
|
|
|
|
|
}
|
|
|
|
@ -1523,7 +1523,7 @@ public class ServiceSynchronize extends ServiceBase implements SharedPreferences
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
wlAccount.release();
|
|
|
|
|
state.acquire(2 * duration, false);
|
|
|
|
|
state.acquire(2 * duration);
|
|
|
|
|
Log.i("### " + account.name + " keeping alive");
|
|
|
|
|
} catch (InterruptedException ex) {
|
|
|
|
|
EntityLog.log(this, account.name + " waited state=" + state);
|
|
|
|
@ -1638,7 +1638,7 @@ public class ServiceSynchronize extends ServiceBase implements SharedPreferences
|
|
|
|
|
if (cbackoff > backoff) {
|
|
|
|
|
try {
|
|
|
|
|
EntityLog.log(this, account.name + " reconnect backoff=" + cbackoff);
|
|
|
|
|
state.acquire(cbackoff * 1000L, true);
|
|
|
|
|
state.acquire(cbackoff * 1000L);
|
|
|
|
|
} catch (InterruptedException ex) {
|
|
|
|
|
Log.w(account.name + " cbackoff " + ex.toString());
|
|
|
|
|
}
|
|
|
|
@ -1648,7 +1648,7 @@ public class ServiceSynchronize extends ServiceBase implements SharedPreferences
|
|
|
|
|
if (backoff <= CONNECT_BACKOFF_MAX) {
|
|
|
|
|
// Short back-off period, keep device awake
|
|
|
|
|
try {
|
|
|
|
|
state.acquire(backoff * 1000L, true);
|
|
|
|
|
state.acquire(backoff * 1000L);
|
|
|
|
|
} catch (InterruptedException ex) {
|
|
|
|
|
Log.w(account.name + " backoff " + ex.toString());
|
|
|
|
|
}
|
|
|
|
@ -1681,7 +1681,7 @@ public class ServiceSynchronize extends ServiceBase implements SharedPreferences
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
wlAccount.release();
|
|
|
|
|
state.acquire(2 * backoff * 1000L, true);
|
|
|
|
|
state.acquire(2 * backoff * 1000L);
|
|
|
|
|
Log.i("### " + account.name + " backoff done");
|
|
|
|
|
} catch (InterruptedException ex) {
|
|
|
|
|
Log.w(account.name + " backoff " + ex.toString());
|
|
|
|
|