Merge commit 'e3e02adac681790ff4bea653e273f7e2b0eea35b' into eclair-mr2-plus-aosp * commit 'e3e02adac681790ff4bea653e273f7e2b0eea35b': Do not trust server-provided content type for attachments
This commit is contained in:
commit
77c7ce54be
@ -305,7 +305,6 @@ public class EasSyncService extends AbstractSyncService {
|
|||||||
if (status == HttpStatus.SC_OK) {
|
if (status == HttpStatus.SC_OK) {
|
||||||
HttpEntity e = res.getEntity();
|
HttpEntity e = res.getEntity();
|
||||||
int len = (int)e.getContentLength();
|
int len = (int)e.getContentLength();
|
||||||
String type = e.getContentType().getValue();
|
|
||||||
InputStream is = res.getEntity().getContent();
|
InputStream is = res.getEntity().getContent();
|
||||||
File f = (req.destination != null)
|
File f = (req.destination != null)
|
||||||
? new File(req.destination)
|
? new File(req.destination)
|
||||||
@ -344,7 +343,6 @@ public class EasSyncService extends AbstractSyncService {
|
|||||||
: "file://" + f.getAbsolutePath();
|
: "file://" + f.getAbsolutePath();
|
||||||
ContentValues cv = new ContentValues();
|
ContentValues cv = new ContentValues();
|
||||||
cv.put(AttachmentColumns.CONTENT_URI, contentUriString);
|
cv.put(AttachmentColumns.CONTENT_URI, contentUriString);
|
||||||
cv.put(AttachmentColumns.MIME_TYPE, type);
|
|
||||||
att.update(mContext, cv);
|
att.update(mContext, cv);
|
||||||
doStatusCallback(msg.mId, att.mId, EmailServiceStatus.SUCCESS);
|
doStatusCallback(msg.mId, att.mId, EmailServiceStatus.SUCCESS);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user