1
0
mirror of https://github.com/etesync/android synced 2024-12-22 22:58:29 +00:00

Don't pop notifications for serviceunavailable errors.

This commit is contained in:
Tom Hacohen 2017-02-20 19:29:53 +00:00
parent 942276284e
commit 09196e52a5
3 changed files with 7 additions and 0 deletions

View File

@ -79,6 +79,9 @@ public class CalendarsSyncAdapterService extends SyncAdapterService {
CalendarSyncManager syncManager = new CalendarSyncManager(getContext(), account, settings, extras, authority, syncResult, calendar, principal);
syncManager.performSync();
}
} catch (Exceptions.ServiceUnavailableException e) {
syncResult.stats.numIoExceptions++;
syncResult.delayUntil = (e.retryAfter > 0) ? e.retryAfter : Constants.DEFAULT_RETRY_DELAY;
} catch (Exception | OutOfMemoryError e) {
if (e instanceof CalendarStorageException || e instanceof SQLiteException) {
App.log.log(Level.SEVERE, "Couldn't prepare local calendars", e);

View File

@ -80,6 +80,9 @@ public class ContactsSyncAdapterService extends SyncAdapterService {
}
} else
App.log.info("No CardDAV service found in DB");
} catch (Exceptions.ServiceUnavailableException e) {
syncResult.stats.numIoExceptions++;
syncResult.delayUntil = (e.retryAfter > 0) ? e.retryAfter : Constants.DEFAULT_RETRY_DELAY;
} catch (Exception | OutOfMemoryError e) {
String syncPhase = SyncManager.SYNC_PHASE_JOURNALS;
String title = getContext().getString(R.string.sync_error_contacts, account.name);

View File

@ -183,6 +183,7 @@ abstract public class SyncManager {
App.log.log(Level.WARNING, "I/O exception during sync, trying again later", e);
syncResult.stats.numIoExceptions++;
} catch (Exceptions.ServiceUnavailableException e) {
syncResult.stats.numIoExceptions++;
syncResult.delayUntil = (e.retryAfter > 0) ? e.retryAfter : Constants.DEFAULT_RETRY_DELAY;
} catch (InterruptedException e) {