summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEkin Oguz <ekinoguz@google.com>2016-12-06 03:17:00 +0000
committerandroid-build-merger <android-build-merger@google.com>2016-12-06 03:17:00 +0000
commitcce602a7ba0bb91b6db5b12c2e6ba60e28a8ce63 (patch)
tree7d8c94b565871331c0186aee410caa9821ef576d
parente642e8e52be6280d9985e12a4493f8277f92e5aa (diff)
parent31240122aac4d82c003f63810c2802bb69e7d58f (diff)
downloadandroid_packages_apps_UnifiedEmail-cce602a7ba0bb91b6db5b12c2e6ba60e28a8ce63.tar.gz
android_packages_apps_UnifiedEmail-cce602a7ba0bb91b6db5b12c2e6ba60e28a8ce63.tar.bz2
android_packages_apps_UnifiedEmail-cce602a7ba0bb91b6db5b12c2e6ba60e28a8ce63.zip
Don't allow file attachment from /data through GET_CONTENT. am: eace8b43e8 am: d21eae6d32 am: ef87f57acc am: 09e62336e5 am: 15c7da491d am: 7e2e3d56c2 am: c8df179fe7
am: 31240122aa Change-Id: I42da1d4b38e44981c4f4a4c79ac3625eae5cee82
-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();
}
}