diff options
author | Ekin Oguz <ekinoguz@google.com> | 2016-12-06 03:01:30 +0000 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2016-12-06 03:01:30 +0000 |
commit | 09e62336e597525083f047ed445ebc68595fbe3f (patch) | |
tree | c729b7cbffb7866c8ccd48d96154d702ae6d2d13 | |
parent | ec677ffff6da6cffb00dc40e68fd0999f31dba70 (diff) | |
parent | ef87f57accbd14f6453415433c5f23823559f2f2 (diff) | |
download | android_packages_apps_UnifiedEmail-09e62336e597525083f047ed445ebc68595fbe3f.tar.gz android_packages_apps_UnifiedEmail-09e62336e597525083f047ed445ebc68595fbe3f.tar.bz2 android_packages_apps_UnifiedEmail-09e62336e597525083f047ed445ebc68595fbe3f.zip |
Don't allow file attachment from /data through GET_CONTENT. am: eace8b43e8 am: d21eae6d32
am: ef87f57acc
Change-Id: Ie0ecb7a8bdde1c39c714240b8b906cd5b375b18f
-rw-r--r-- | src/com/android/mail/compose/ComposeActivity.java | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/src/com/android/mail/compose/ComposeActivity.java b/src/com/android/mail/compose/ComposeActivity.java index 2dfac99b9..5f125abe6 100644 --- a/src/com/android/mail/compose/ComposeActivity.java +++ b/src/com/android/mail/compose/ComposeActivity.java @@ -2018,19 +2018,15 @@ public class ComposeActivity extends ActionBarActivity 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(); } } |