Fix #2490068 (Exchange 2003 won't upload)

* It turns out that Events don't store null for empty fields like location
  and description, but rather an empty string.
* Exchange 2003 doesn't like seeing empty values, so check for this before
  uploading.

Bug: 2490068

Change-Id: Ib208f9d6ec116a99adf798939dfbc4d4bdd15edf
This commit is contained in:
Marc Blank 2010-03-04 21:03:08 -08:00
parent 08ea24ff99
commit db9f3d2441
3 changed files with 10 additions and 5 deletions

View File

@ -18,8 +18,8 @@
package com.android.exchange;
import com.android.email.SecurityPolicy;
import com.android.email.SecurityPolicy.PolicySet;
import com.android.email.Utility;
import com.android.email.SecurityPolicy.PolicySet;
import com.android.email.mail.Address;
import com.android.email.mail.AuthenticationFailedException;
import com.android.email.mail.MeetingInfo;

View File

@ -18,10 +18,10 @@
package com.android.exchange.adapter;
import com.android.email.Email;
import com.android.email.Utility;
import com.android.email.provider.EmailContent;
import com.android.email.provider.EmailContent.Mailbox;
import com.android.email.provider.EmailContent.Message;
import com.android.email.Utility;
import com.android.exchange.EasOutboxService;
import com.android.exchange.EasSyncService;
import com.android.exchange.utility.CalendarUtilities;
@ -1064,7 +1064,7 @@ public class CalendarSyncAdapter extends AbstractSyncAdapter {
if (!isException) {
String desc = entityValues.getAsString(Events.DESCRIPTION);
if (desc != null) {
if (desc != null && desc.length() > 0) {
if (mService.mProtocolVersionDouble >= 12.0) {
s.start(Tags.BASE_BODY);
s.data(Tags.BASE_TYPE, "1");

View File

@ -37,7 +37,7 @@ import java.util.Hashtable;
public class Serializer {
private static final String TAG = "Serializer";
private static final boolean logging = false; // DO NOT CHECK IN WITH THIS TRUE!
private boolean logging = false; // DO NOT CHECK IN WITH THIS TRUE!
private static final int NOT_PENDING = -1;
@ -58,6 +58,11 @@ public class Serializer {
this(true);
}
public Serializer(boolean startDocument, boolean _logging) {
this(true);
logging = _logging;
}
public Serializer(boolean startDocument) {
super();
if (startDocument) {
@ -203,7 +208,7 @@ public class Serializer {
void writeStringValue (ContentValues cv, String key, int tag) throws IOException {
String value = cv.getAsString(key);
if (value != null) {
if (value != null && value.length() > 0) {
data(tag, value);
}
}