summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEkin Oguz <ekinoguz@google.com>2016-12-06 02:58:27 +0000
committerandroid-build-merger <android-build-merger@google.com>2016-12-06 02:58:27 +0000
commitef87f57accbd14f6453415433c5f23823559f2f2 (patch)
tree4220cc2026faa172ff3d5daca18f9c624d4cc737
parent3a9c3b091b7cb53c5230e2e879ed37454e7443d6 (diff)
parentd21eae6d325bc0e1e7d25a67ae68b841bdf0449d (diff)
downloadandroid_packages_apps_UnifiedEmail-ef87f57accbd14f6453415433c5f23823559f2f2.tar.gz
android_packages_apps_UnifiedEmail-ef87f57accbd14f6453415433c5f23823559f2f2.tar.bz2
android_packages_apps_UnifiedEmail-ef87f57accbd14f6453415433c5f23823559f2f2.zip
Don't allow file attachment from /data through GET_CONTENT. am: eace8b43e8
am: d21eae6d32 Change-Id: If991dfc01641f30ce1cc392d2ecfe38fdfdeaada
-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();
}
}