1
0
Fork 0
mirror of https://github.com/M66B/FairEmail.git synced 2025-01-03 21:55:13 +00:00

Limit long back-off time

This commit is contained in:
M66B 2021-08-06 07:39:11 +02:00
parent 85e00b7742
commit 8e1275e052

View file

@ -2153,8 +2153,12 @@ public class ServiceSynchronize extends ServiceBase implements SharedPreferences
state.setBackoff(backoff * 2);
else if (backoff == CONNECT_BACKOFF_MAX)
state.setBackoff(CONNECT_BACKOFF_ALARM_START * 60);
else if (backoff < CONNECT_BACKOFF_ALARM_MAX * 60)
state.setBackoff(backoff * 2);
else if (backoff < CONNECT_BACKOFF_ALARM_MAX * 60) {
int b = backoff * 2;
if (b > CONNECT_BACKOFF_ALARM_MAX * 60)
b = CONNECT_BACKOFF_ALARM_MAX * 60;
state.setBackoff(b);
}
if (backoff <= CONNECT_BACKOFF_MAX) {
// Short back-off period, keep device awake