Removed is charging logic

This commit is contained in:
M66B 2021-06-17 07:45:33 +02:00
parent 9d9a5c32da
commit 9e939373b8
1 changed files with 2 additions and 5 deletions

View File

@ -2059,7 +2059,7 @@ public class ServiceSynchronize extends ServiceBase implements SharedPreferences
long poll_interval = Math.min(account.poll_interval, CONNECT_BACKOFF_ALARM_START);
long fail_threshold = poll_interval * 60 * 1000L * FAST_FAIL_THRESHOLD / 100;
long was_connected = (account.last_connected == null ? 0 : now - account.last_connected);
if (was_connected < fail_threshold && !Helper.isCharging(this)) {
if (was_connected < fail_threshold) {
if (state.getBackoff() == CONNECT_BACKOFF_START) {
fast_fails++;
if (fast_fails == 1)
@ -2110,10 +2110,7 @@ public class ServiceSynchronize extends ServiceBase implements SharedPreferences
if (backoff < CONNECT_BACKOFF_MAX)
state.setBackoff(backoff * 2);
else if (backoff == CONNECT_BACKOFF_MAX)
if (Helper.isCharging(this))
EntityLog.log(this, "Device is charging");
else
state.setBackoff(CONNECT_BACKOFF_ALARM_START * 60);
state.setBackoff(CONNECT_BACKOFF_ALARM_START * 60);
else if (backoff < CONNECT_BACKOFF_ALARM_MAX * 60)
state.setBackoff(backoff * 2);