Revert "Handle save of loaded attachments"
This reverts commit 2c07a3f2e7a9c271298352cff77899e895050a8c.
diff --git a/src/com/android/exchange/adapter/AttachmentLoader.java b/src/com/android/exchange/adapter/AttachmentLoader.java
index 2a6e7ae..04cf555 100644
--- a/src/com/android/exchange/adapter/AttachmentLoader.java
+++ b/src/com/android/exchange/adapter/AttachmentLoader.java
@@ -90,30 +90,13 @@
}
/**
- * If this attachment was destined for external storage, move it there. In either event, make
- * sure the attachment itself is updated and the callback sent
+ * Save away the contentUri for this Attachment and notify listeners
*/
private void finishLoadAttachment() {
- // The file has been downloaded to the cache
- if (mAttachment.mUiDestination == UIProvider.AttachmentDestination.EXTERNAL) {
- // If we want it saved, save it and delete the cached version
- try {
- InputStream in = mResolver.openInputStream(mAttachmentUri);
- // Note that saveAttachment updates the attachment itself
- AttachmentUtilities.saveAttachment(mContext, in, mAttachment);
- // We don't need the cached file anymore
- mResolver.delete(mAttachmentUri, null, null);
- } catch (FileNotFoundException e) {
- // Something of a WTF, since we just created it
- doStatusCallback(EmailServiceStatus.ATTACHMENT_NOT_FOUND);
- return;
- }
- } else {
- ContentValues cv = new ContentValues();
- cv.put(AttachmentColumns.CONTENT_URI, mAttachmentUri.toString());
- cv.put(AttachmentColumns.UI_STATE, UIProvider.AttachmentState.SAVED);
- mAttachment.update(mContext, cv);
- }
+ ContentValues cv = new ContentValues();
+ cv.put(AttachmentColumns.CONTENT_URI, mAttachmentUri.toString());
+ cv.put(AttachmentColumns.UI_STATE, UIProvider.AttachmentState.SAVED);
+ mAttachment.update(mContext, cv);
doStatusCallback(EmailServiceStatus.SUCCESS);
}