Handle "Sync" status 5 as an IOException
* Failure to do so leads to fast looping behavior and battery drain until
the server fixes itself up. Best to treat it as an IOException and use
our built-in backoff behavior
Bug: 5135583
Change-Id: Ied7cfe09f5ae725d1c307ea48dd4bbf52f321c6a
diff --git a/src/com/android/exchange/adapter/AbstractSyncParser.java b/src/com/android/exchange/adapter/AbstractSyncParser.java
index 69d4ba4..a67b916 100644
--- a/src/com/android/exchange/adapter/AbstractSyncParser.java
+++ b/src/com/android/exchange/adapter/AbstractSyncParser.java
@@ -142,8 +142,10 @@
mAdapter.wipe();
// Indicate there's more so that we'll start syncing again
moreAvailable = true;
- } else if (status == 16) {
- // Status 16 indicates a transient server error
+ } else if (status == 16 || status == 5) {
+ // Status 16 indicates a transient server error (indeterminate state)
+ // Status 5 indicates "server error"; this tends to loop for a while so
+ // throwing IOException will at least provide backoff behavior
throw new IOException();
} else if (status == 8 || status == 12) {
// Status 8 is Bad; it means the server doesn't recognize the serverId it