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:
parent
85e00b7742
commit
8e1275e052
1 changed files with 6 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue