am 1e1d7cb1: Merge change Ie2804ddc into eclair

Merge commit '1e1d7cb189e7ea7164d1335539d68d3d3ca8c0e5' into eclair-mr2

* commit '1e1d7cb189e7ea7164d1335539d68d3d3ca8c0e5':
  Fix #2225869 (Regression in attachment loading / Exchange 2003)
This commit is contained in:
Marc Blank 2009-10-30 14:33:58 -07:00 committed by Android Git Automerger
commit e7965e975f
1 changed files with 6 additions and 6 deletions

View File

@ -295,12 +295,10 @@ public class EasSyncService extends AbstractSyncService {
Attachment att = req.att;
Message msg = Message.restoreMessageWithId(mContext, att.mMessageKey);
doProgressCallback(msg.mId, att.mId, 0);
HttpClient client = getHttpClient(COMMAND_TIMEOUT);
String us = makeUriString("GetAttachment", "&AttachmentName=" + att.mLocation);
HttpPost method = new HttpPost(URI.create(us));
method.setHeader("Authorization", mAuthString);
HttpResponse res = client.execute(method);
String cmd = "GetAttachment&AttachmentName=" + att.mLocation;
HttpResponse res = sendHttpClientPost(cmd, null, COMMAND_TIMEOUT);
int status = res.getStatusLine().getStatusCode();
if (status == HttpStatus.SC_OK) {
HttpEntity e = res.getEntity();
@ -428,9 +426,11 @@ public class EasSyncService extends AbstractSyncService {
String us = makeUriString(cmd, extra);
HttpPost method = new HttpPost(URI.create(us));
// Send the proper Content-Type header
// If entity is null (e.g. for attachments), don't set this header
if (msg) {
method.setHeader("Content-Type", "message/rfc822");
} else {
} else if (entity != null) {
method.setHeader("Content-Type", "application/vnd.ms-sync.wbxml");
}
setHeaders(method);