Merge cherrypicks of [3551537, 3552808, 3552809, 3551513, 3551514, 3554326, 3555207, 3555208, 3555209, 3555210, 3552110, 3555154, 3555155] into oc-m2-release
Change-Id: I50ced1da0473f15226fccb3d4e89003e362d40b7
diff --git a/src/com/android/mail/compose/ComposeActivity.java b/src/com/android/mail/compose/ComposeActivity.java
index 738111f..3dd9e87 100644
--- a/src/com/android/mail/compose/ComposeActivity.java
+++ b/src/com/android/mail/compose/ComposeActivity.java
@@ -1924,6 +1924,15 @@
}
/**
+ * @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 @@
}
} 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);