Don't allow file attachment from /data through GET_CONTENT. am: eace8b43e8 am: d21eae6d32
am: ef87f57acc
Change-Id: Ie0ecb7a8bdde1c39c714240b8b906cd5b375b18f
diff --git a/src/com/android/mail/compose/ComposeActivity.java b/src/com/android/mail/compose/ComposeActivity.java
index 2dfac99..5f125ab 100644
--- a/src/com/android/mail/compose/ComposeActivity.java
+++ b/src/com/android/mail/compose/ComposeActivity.java
@@ -2018,19 +2018,15 @@
if (contentUri == null) {
return;
}
- try {
- if (handleSpecialAttachmentUri(contentUri)) {
- return;
- }
+ if (handleSpecialAttachmentUri(contentUri)) {
+ return;
+ }
- addAttachmentAndUpdateView(mAttachmentsView.generateLocalAttachment(contentUri));
- } catch (AttachmentFailureException e) {
- LogUtils.e(LOG_TAG, e, "Error adding attachment");
- showErrorToast(getResources().getString(
- e.getErrorRes(),
- AttachmentUtils.convertToHumanReadableSize(
- getApplicationContext(), mAccount.settings.getMaxAttachmentSize())));
+ final long size = handleAttachmentUrisFromIntent(Arrays.asList(contentUri));
+ if (size > 0) {
+ mAttachmentsChanged = true;
+ updateSaveUi();
}
}