summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEkin Oguz <ekinoguz@google.com>2016-12-06 03:07:28 +0000
committerandroid-build-merger <android-build-merger@google.com>2016-12-06 03:07:28 +0000
commit7e2e3d56c2a5d65146765b18e7a939451befc768 (patch)
tree199bf750a9c979bace62b19b0874de9123cf2d0b
parente04035768d2a1b4695a25ff5e203c4a95a38981e (diff)
parent15c7da491dce69ff8f182cb7bfa496b87a4ece35 (diff)
downloadandroid_packages_apps_UnifiedEmail-7e2e3d56c2a5d65146765b18e7a939451befc768.tar.gz
android_packages_apps_UnifiedEmail-7e2e3d56c2a5d65146765b18e7a939451befc768.tar.bz2
android_packages_apps_UnifiedEmail-7e2e3d56c2a5d65146765b18e7a939451befc768.zip
Don't allow file attachment from /data through GET_CONTENT. am: eace8b43e8 am: d21eae6d32 am: ef87f57acc am: 09e62336e5
am: 15c7da491d Change-Id: I2383b1507fdd22b1ba6fb8467bc388a43a97256c
-rw-r--r--src/com/android/mail/compose/ComposeActivity.java18
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();
}
}