Fixed early sync error report

pull/191/head
M66B 4 years ago
parent d3c35746f0
commit 22259594cc

@ -1785,7 +1785,8 @@ public class ServiceSynchronize extends ServiceBase implements SharedPreferences
long delayed = now - account.last_connected - account.poll_interval * 60 * 1000L;
long maxDelayed = (pollInterval > 0 && !account.poll_exempted
? pollInterval * ACCOUNT_ERROR_AFTER_POLL : ACCOUNT_ERROR_AFTER) * 60 * 1000L;
if (delayed > maxDelayed) {
if (delayed > maxDelayed &&
state.getBackoff() >= CONNECT_BACKOFF_ALARM_START * 60) {
Log.i("Reporting sync error after=" + delayed);
Throwable warning = new Throwable(
getString(R.string.title_no_sync,
@ -1795,7 +1796,6 @@ public class ServiceSynchronize extends ServiceBase implements SharedPreferences
NotificationManager nm = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
nm.notify("receive:" + account.id, 1,
Core.getNotificationError(this, "warning", account.name, warning)
.setOnlyAlertOnce(state.getBackoff() < CONNECT_BACKOFF_ALARM_START * 60 * 1000L)
.build());
} catch (Throwable ex1) {
Log.w(ex1);

Loading…
Cancel
Save