diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index 54cc166e9..9b376afda 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -162,9 +162,7 @@
-
-
-
+
diff --git a/src/com/android/email/Email.java b/src/com/android/email/Email.java
index 4a6b90b5c..2807e50db 100644
--- a/src/com/android/email/Email.java
+++ b/src/com/android/email/Email.java
@@ -67,15 +67,21 @@ public class Email extends Application {
public static final boolean LOGD = false;
/**
- * The MIME type(s) of attachments we're willing to send. At the moment it is not possible
- * to open a chooser with a list of filter types, so the chooser is only opened with the first
- * item in the list. The entire list will be used to filter down attachments that are added
- * with Intent.ACTION_SEND.
+ * The MIME type(s) of attachments we're willing to send via attachments.
*
- * TODO: It should be legal to send anything requested by another app. This would provide
- * parity with Gmail's behavior.
+ * Any attachments may be added via Intents with Intent.ACTION_SEND or ACTION_SEND_MULTIPLE.
*/
- public static final String[] ACCEPTABLE_ATTACHMENT_SEND_TYPES = new String[] {
+ public static final String[] ACCEPTABLE_ATTACHMENT_SEND_INTENT_TYPES = new String[] {
+ "*/*",
+ };
+
+ /**
+ * The MIME type(s) of attachments we're willing to send from the internal UI.
+ *
+ * NOTE: At the moment it is not possible to open a chooser with a list of filter types, so
+ * the chooser is only opened with the first item in the list.
+ */
+ public static final String[] ACCEPTABLE_ATTACHMENT_SEND_UI_TYPES = new String[] {
"image/*",
"video/*",
};
diff --git a/src/com/android/email/activity/MessageCompose.java b/src/com/android/email/activity/MessageCompose.java
index e8f8c2dd0..fdc7a933f 100644
--- a/src/com/android/email/activity/MessageCompose.java
+++ b/src/com/android/email/activity/MessageCompose.java
@@ -884,7 +884,7 @@ public class MessageCompose extends Activity implements OnClickListener, OnFocus
private void onAddAttachment() {
Intent i = new Intent(Intent.ACTION_GET_CONTENT);
i.addCategory(Intent.CATEGORY_OPENABLE);
- i.setType(Email.ACCEPTABLE_ATTACHMENT_SEND_TYPES[0]);
+ i.setType(Email.ACCEPTABLE_ATTACHMENT_SEND_UI_TYPES[0]);
startActivityForResult(
Intent.createChooser(i, getString(R.string.choose_attachment_dialog_title)),
ACTIVITY_REQUEST_PICK_ATTACHMENT);
@@ -1110,7 +1110,8 @@ public class MessageCompose extends Activity implements OnClickListener, OnFocus
String type = intent.getType();
Uri stream = (Uri) intent.getParcelableExtra(Intent.EXTRA_STREAM);
if (stream != null && type != null) {
- if (MimeUtility.mimeTypeMatches(type, Email.ACCEPTABLE_ATTACHMENT_SEND_TYPES)) {
+ if (MimeUtility.mimeTypeMatches(type,
+ Email.ACCEPTABLE_ATTACHMENT_SEND_INTENT_TYPES)) {
addAttachment(stream);
}
}
@@ -1124,8 +1125,8 @@ public class MessageCompose extends Activity implements OnClickListener, OnFocus
Uri uri = (Uri) parcelable;
if (uri != null) {
Attachment attachment = loadAttachmentInfo(uri);
- if (MimeUtility.mimeTypeMatches(attachment.mMimeType,
- Email.ACCEPTABLE_ATTACHMENT_SEND_TYPES)) {
+ if (MimeUtility.mimeTypeMatches(attachment.mMimeType,
+ Email.ACCEPTABLE_ATTACHMENT_SEND_INTENT_TYPES)) {
addAttachment(attachment);
}
}