From d0848056f18bd2ea96aad0b08104e10b9f11d7e0 Mon Sep 17 00:00:00 2001 From: Marc Blank Date: Mon, 5 Oct 2009 10:26:20 -0700 Subject: [PATCH] Correct issue with mail change parsing (fixes #2165649) * Older parsing code that didn't take into account the fact that 'flag' is a structured data item * Requires Dr. No approval for Eclair_Sholes Change-Id: Id1c0bc24e784b19c598d2b852975e135abebbdb0 --- .../exchange/adapter/EmailSyncAdapter.java | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/src/com/android/exchange/adapter/EmailSyncAdapter.java b/src/com/android/exchange/adapter/EmailSyncAdapter.java index 8d59da42a..6a5d2a5cd 100644 --- a/src/com/android/exchange/adapter/EmailSyncAdapter.java +++ b/src/com/android/exchange/adapter/EmailSyncAdapter.java @@ -353,9 +353,7 @@ public class EmailSyncAdapter extends AbstractSyncAdapter { private void changeParser(ArrayList changes) throws IOException { String serverId = null; Boolean oldRead = false; - Boolean read = null; Boolean oldFlag = false; - Boolean flag = null; long id = 0; while (nextTag(Tags.SYNC_CHANGE) != END) { switch (tag) { @@ -373,14 +371,27 @@ public class EmailSyncAdapter extends AbstractSyncAdapter { c.close(); } break; + case Tags.SYNC_APPLICATION_DATA: + changeApplicationDataParser(changes, oldRead, oldFlag, id); + break; + default: + skipTag(); + } + } + } + + private void changeApplicationDataParser(ArrayList changes, Boolean oldRead, + Boolean oldFlag, long id) throws IOException { + Boolean read = null; + Boolean flag = null; + while (nextTag(Tags.SYNC_APPLICATION_DATA) != END) { + switch (tag) { case Tags.EMAIL_READ: read = getValueInt() == 1; break; case Tags.EMAIL_FLAG: flag = flagParser(); break; - case Tags.SYNC_APPLICATION_DATA: - break; default: skipTag(); }