summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndroid Build Merger (Role) <noreply-android-build-merger@google.com>2018-02-01 03:14:32 +0000
committerandroid-build-merger <android-build-merger@google.com>2018-02-01 03:14:32 +0000
commit988f211a1b0f48749703bcb69d7f8b38e7219c21 (patch)
treea393001243a9630f2e7a1d5289953f9f3423832a
parent5e14277b98a75e5ba209fe27de8eeee5d0a48e5f (diff)
parentf8601c0c2a30887a650a3e85a2aad2c77f4ab7f6 (diff)
downloadUnifiedEmail-988f211a1b0f48749703bcb69d7f8b38e7219c21.tar.gz
[automerger] Disallow attaching files from our own EmailAttachmentProvider. am: 44a5db2dc0 am: ec59cd4c39 am: 7764908d8d am: 29f9af1b0a am: 1f74cbabba am: 9a7c825a34 am: 4c824af722 am: 425e9f9156 am: c94203d0c3 am: 5d2c780a76 am: 35ead32a64 am: f842517566 am: d5431e6730 am: 1a9c0f00c4
am: f8601c0c2a Change-Id: I884bf5c7e9aa5bee10cd07337ed808d202b6d7b0
-rw-r--r--src/com/android/mail/compose/ComposeActivity.java13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/com/android/mail/compose/ComposeActivity.java b/src/com/android/mail/compose/ComposeActivity.java
index 738111f90..3dd9e8744 100644
--- a/src/com/android/mail/compose/ComposeActivity.java
+++ b/src/com/android/mail/compose/ComposeActivity.java
@@ -1924,6 +1924,15 @@ public class ComposeActivity extends AppCompatActivity
}
/**
+ * @return the authority of EmailAttachmentProvider for this app. should be overridden in
+ * concrete app implementations. can't be known here because this project doesn't know about
+ * that sort of thing.
+ */
+ protected String getEmailAttachmentProviderAuthority() {
+ throw new UnsupportedOperationException("unimplemented, EmailAttachmentProvider unknown");
+ }
+
+ /**
* Helper function to handle a list of uris to attach.
* @return true if anything has been attached.
*/
@@ -1944,7 +1953,9 @@ public class ComposeActivity extends AppCompatActivity
}
} else if (ContentResolver.SCHEME_CONTENT.equals(uri.getScheme())) {
// disallow attachments from our own EmailProvider (b/27308057)
- if (getEmailProviderAuthority().equals(uri.getAuthority())) {
+ if (getEmailProviderAuthority().equals(uri.getAuthority())
+ || getEmailAttachmentProviderAuthority().equals(
+ uri.getAuthority())) {
showErrorToast(getString(R.string.attachment_permission_denied));
Analytics.getInstance().sendEvent(ANALYTICS_CATEGORY_ERRORS,
"send_intent_attachment", "email_provider", 0);