Allow acceptable media types only for sharing am: a8b76eafc4
Change-Id: If336f625c4dc344fba9fd39387b915e1fe1e24a4
This commit is contained in:
@@ -341,6 +341,11 @@ public class MessagePartData implements Parcelable {
|
|||||||
return mHeight;
|
return mHeight;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static boolean isSupportedMediaType(final String contentType) {
|
||||||
|
return ContentType.isVCardType(contentType)
|
||||||
|
|| Arrays.asList(ACCEPTABLE_GALLERY_MEDIA_TYPES).contains(contentType);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @return true if this part can only exist by itself, with no other attachments
|
* @return true if this part can only exist by itself, with no other attachments
|
||||||
|
|||||||
@@ -103,7 +103,7 @@ public class ShareIntentActivity extends BaseBugleActivity implements
|
|||||||
}
|
}
|
||||||
mDraftMessage =
|
mDraftMessage =
|
||||||
sharedText != null ? MessageData.createSharedMessage(sharedText) : null;
|
sharedText != null ? MessageData.createSharedMessage(sharedText) : null;
|
||||||
} else if (ContentType.isMediaType(contentType)) {
|
} else if (PendingAttachmentData.isSupportedMediaType(contentType)) {
|
||||||
if (contentUri != null) {
|
if (contentUri != null) {
|
||||||
mDraftMessage = MessageData.createSharedMessage(null);
|
mDraftMessage = MessageData.createSharedMessage(null);
|
||||||
addSharedPartToDraft(contentType, contentUri);
|
addSharedPartToDraft(contentType, contentUri);
|
||||||
@@ -139,7 +139,7 @@ public class ShareIntentActivity extends BaseBugleActivity implements
|
|||||||
}
|
}
|
||||||
strBuffer.append(sharedText);
|
strBuffer.append(sharedText);
|
||||||
}
|
}
|
||||||
} else if (ContentType.isMediaType(actualContentType)) {
|
} else if (PendingAttachmentData.isSupportedMediaType(actualContentType)) {
|
||||||
uriMap.put(uri, actualContentType);
|
uriMap.put(uri, actualContentType);
|
||||||
} else {
|
} else {
|
||||||
// Unsupported content type.
|
// Unsupported content type.
|
||||||
|
|||||||
Reference in New Issue
Block a user