From 54181220e2936163941cb3e219a64f0720acd467 Mon Sep 17 00:00:00 2001 From: Marc Blank Date: Fri, 5 Mar 2010 17:53:56 -0800 Subject: [PATCH] Fix #2492864 (Upsync failures in Exchange 2003) * Of all crazy things, Exchange 2003 doesn't like uploading the organizer's email/name in changes. This isn't documented anywhere. * Don't send up organizer name/email on changes. Bug: 2492864 Change-Id: I1f2aefb6f9020025578325c5c7b3cf869f17e27f --- .../exchange/adapter/CalendarSyncAdapter.java | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/com/android/exchange/adapter/CalendarSyncAdapter.java b/src/com/android/exchange/adapter/CalendarSyncAdapter.java index a1f30861d..663e77987 100644 --- a/src/com/android/exchange/adapter/CalendarSyncAdapter.java +++ b/src/com/android/exchange/adapter/CalendarSyncAdapter.java @@ -1002,6 +1002,7 @@ public class CalendarSyncAdapter extends AbstractSyncAdapter { ContentValues entityValues = entity.getEntityValues(); boolean isException = (clientId == null); boolean hasAttendees = false; + boolean isChange = entityValues.containsKey(Events._SYNC_ID); if (!isException) { // A time zone is required in all EAS events; we'll use the default if none is set @@ -1075,7 +1076,11 @@ public class CalendarSyncAdapter extends AbstractSyncAdapter { } } - s.writeStringValue(entityValues, Events.ORGANIZER, Tags.CALENDAR_ORGANIZER_EMAIL); + // We only write organizer email if the event is new (not a change) + // Exchange 2003 will reject upsyncs of changed events with organizer email + if (!isChange) { + s.writeStringValue(entityValues, Events.ORGANIZER, Tags.CALENDAR_ORGANIZER_EMAIL); + } String rrule = entityValues.getAsString(Events.RRULE); if (rrule != null) { @@ -1153,7 +1158,10 @@ public class CalendarSyncAdapter extends AbstractSyncAdapter { if (hasAttendees) { s.end(); // Attendees } - if (organizerName != null) { + + // We only write organizer name if the event is new (not a change) + // Exchange 2003 will reject upsyncs of changed events with organizer name + if (!isChange && organizerName != null) { s.data(Tags.CALENDAR_ORGANIZER_NAME, organizerName); } } else {