/packages/apps/Messaging/src/com/android/messaging/util/ |
D | ContentType.java | 104 public static boolean isTextType(final String contentType) { in isTextType() argument 105 return TEXT_PLAIN.equals(contentType) in isTextType() 106 || TEXT_HTML.equals(contentType) in isTextType() 107 || APP_WAP_XHTML.equals(contentType); in isTextType() 110 public static boolean isMediaType(final String contentType) { in isMediaType() argument 111 return isImageType(contentType) in isMediaType() 112 || isVideoType(contentType) in isMediaType() 113 || isAudioType(contentType) in isMediaType() 114 || isVCardType(contentType); in isMediaType() 117 public static boolean isImageType(final String contentType) { in isImageType() argument [all …]
|
D | ImageUtils.java | 227 String contentType = null; in getContentType() local 234 contentType = cursor.getString(INDEX_CONTENT_TYPE); in getContentType() 242 if (contentType == null) { in getContentType() 244 contentType = ContentType.getContentTypeFromExtension(uri.toString(), in getContentType() 247 return contentType; in getContentType() 297 public static boolean isGif(String contentType, Uri contentUri) { in isGif() argument 298 if (TextUtils.equals(contentType, ContentType.IMAGE_GIF)) { in isGif() 301 if (ContentType.isImageType(contentType)) { in isGif() 430 final String contentType) { in getResizedImageData() argument 432 widthLimit, heightLimit, byteLimit, uri, context, contentType); in getResizedImageData() [all …]
|
/packages/apps/Messaging/src/android/support/v7/mms/pdu/ |
D | ContentType.java | 169 public static boolean isSupportedType(String contentType) { in isSupportedType() argument 170 return (null != contentType) && sSupportedContentTypes.contains(contentType); in isSupportedType() 173 public static boolean isSupportedImageType(String contentType) { in isSupportedImageType() argument 174 return isImageType(contentType) && isSupportedType(contentType); in isSupportedImageType() 177 public static boolean isSupportedAudioType(String contentType) { in isSupportedAudioType() argument 178 return isAudioType(contentType) && isSupportedType(contentType); in isSupportedAudioType() 181 public static boolean isSupportedVideoType(String contentType) { in isSupportedVideoType() argument 182 return isVideoType(contentType) && isSupportedType(contentType); in isSupportedVideoType() 185 public static boolean isTextType(String contentType) { in isTextType() argument 186 return (null != contentType) && contentType.startsWith("text/"); in isTextType() [all …]
|
D | PduParser.java | 172 byte[] contentType = retrieveConf.getContentType(); in parse() 173 if (null == contentType) { in parse() 176 String ctTypeStr = new String(contentType); in parse() 783 byte[] contentType = in parseHeaders() 786 if (null != contentType) { in parseHeaders() 790 Arrays.toString(contentType)); in parseHeaders() 792 headers.setTextString(contentType, PduHeaders.CONTENT_TYPE); in parseHeaders() 852 byte[] contentType = parseContentType(pduDataStream, map); in parseParts() 853 if (null != contentType) { in parseParts() 854 part.setContentType(contentType); in parseParts() [all …]
|
/packages/apps/Messaging/src/com/android/messaging/ui/conversationlist/ |
D | ShareIntentActivity.java | 85 final String contentType = extractContentType(contentUri, intent.getType()); in onAttachFragment() local 89 contentUri, intent.getType(), contentType)); in onAttachFragment() 91 if (ContentType.TEXT_PLAIN.equals(contentType)) { in onAttachFragment() 98 } else if (ContentType.isImageType(contentType) || in onAttachFragment() 99 ContentType.isVCardType(contentType) || in onAttachFragment() 100 ContentType.isAudioType(contentType) || in onAttachFragment() 101 ContentType.isVideoType(contentType)) { in onAttachFragment() 104 addSharedImagePartToDraft(contentType, contentUri); in onAttachFragment() 110 Assert.fail("Unsupported shared content type for " + contentUri + ": " + contentType in onAttachFragment() 114 final String contentType = intent.getType(); in onAttachFragment() local [all …]
|
/packages/apps/Dialer/java/com/android/voicemail/impl/mail/internet/ |
D | MimeMultipart.java | 30 protected String contentType; field in MimeMultipart 41 public MimeMultipart(String contentType) throws MessagingException { in MimeMultipart() argument 42 this.contentType = contentType; in MimeMultipart() 44 subType = MimeUtility.getHeaderParameter(contentType, null).split("/")[1]; in MimeMultipart() 45 boundary = MimeUtility.getHeaderParameter(contentType, "boundary"); in MimeMultipart() 47 throw new MessagingException("MultiPart does not contain boundary: " + contentType); in MimeMultipart() 52 + contentType in MimeMultipart() 77 return contentType; in getContentType() 82 contentType = String.format("multipart/%s; boundary=\"%s\"", subType, boundary); in setSubType()
|
D | MimeBodyPart.java | 93 String contentType = String.format("%s;\n charset=utf-8", getMimeType()); in setBody() local 96 contentType += String.format(";\n name=\"%s\"", name); in setBody() 98 setHeader(MimeHeader.HEADER_CONTENT_TYPE, contentType); in setBody() 105 String contentType = getFirstHeader(MimeHeader.HEADER_CONTENT_TYPE); in getContentType() local 106 if (contentType == null) { in getContentType() 109 return contentType; in getContentType()
|
/packages/apps/Messaging/src/com/android/messaging/datamodel/data/ |
D | PendingAttachmentData.java | 57 protected PendingAttachmentData(final String caption, final String contentType, in PendingAttachmentData() argument 60 super(caption, contentType, sourceUri, width, height, onlySingleAttachment); in PendingAttachmentData() 68 public static PendingAttachmentData createPendingAttachmentData(final String contentType, in createPendingAttachmentData() argument 70 return createPendingAttachmentData(null, contentType, sourceUri, UNSPECIFIED_SIZE, in createPendingAttachmentData() 75 final String contentType, final Uri sourceUri, final int width, final int height) { in createPendingAttachmentData() argument 76 Assert.isTrue(ContentType.isMediaType(contentType)); in createPendingAttachmentData() 77 return new PendingAttachmentData(caption, contentType, sourceUri, width, height, in createPendingAttachmentData() 82 final String contentType, final Uri sourceUri, final int width, final int height, in createPendingAttachmentData() argument 84 Assert.isTrue(ContentType.isMediaType(contentType)); in createPendingAttachmentData() 85 return new PendingAttachmentData(caption, contentType, sourceUri, width, height, in createPendingAttachmentData()
|
D | MediaPickerMessagePartData.java | 25 public MediaPickerMessagePartData(final Rect startRect, final String contentType, in MediaPickerMessagePartData() argument 27 this(startRect, null /* messageText */, contentType, contentUri, width, height); in MediaPickerMessagePartData() 31 final String contentType, final Uri contentUri, final int width, final int height) { in MediaPickerMessagePartData() argument 32 this(startRect, messageText, contentType, contentUri, width, height, in MediaPickerMessagePartData() 36 public MediaPickerMessagePartData(final Rect startRect, final String contentType, in MediaPickerMessagePartData() argument 39 this(startRect, null /* messageText */, contentType, contentUri, width, height, in MediaPickerMessagePartData() 44 final String contentType, final Uri contentUri, final int width, final int height, in MediaPickerMessagePartData() argument 46 super(messageText, contentType, contentUri, width, height, onlySingleAttachment); in MediaPickerMessagePartData()
|
D | MessagePartData.java | 120 protected MessagePartData(final String contentType, final Uri contentUri, in MessagePartData() argument 122 this(null, null, contentType, contentUri, width, height, false /*singlePartOnly*/); in MessagePartData() 128 protected MessagePartData(final String messageText, final String contentType, in MessagePartData() argument 130 this(null, messageText, contentType, contentUri, width, height, false /*singlePartOnly*/); in MessagePartData() 136 protected MessagePartData(final String messageText, final String contentType, in MessagePartData() argument 138 this(null, messageText, contentType, contentUri, width, height, singlePartOnly); in MessagePartData() 145 final String contentType, final Uri contentUri, final int width, final int height, in MessagePartData() argument 149 mContentType = contentType; in MessagePartData() 166 public static MessagePartData createMediaMessagePart(final String contentType, in createMediaMessagePart() argument 168 return new MessagePartData(contentType, contentUri, width, height); in createMediaMessagePart() [all …]
|
/packages/apps/UnifiedEmail/src/com/android/mail/providers/ |
D | Attachment.java | 96 private String contentType; field in Attachment 186 contentType = in.readString(); in Attachment() 208 contentType = cursor.getString(cursor.getColumnIndex(AttachmentColumns.CONTENT_TYPE)); in Attachment() 230 contentType = srcJson.optString(AttachmentColumns.CONTENT_TYPE, null); in Attachment() 264 contentType = MimeType.inferMimeType(name, part.getMimeType()); in Attachment() 310 contentType = values.getAsString(AttachmentColumns.CONTENT_TYPE); in Attachment() 336 values.put(AttachmentColumns.CONTENT_TYPE, contentType); in toContentValues() 359 dest.writeString(contentType); in writeToParcel() 379 result.put(AttachmentColumns.CONTENT_TYPE, contentType); in toJSON() 494 inferredContentType = MimeType.inferMimeType(name, contentType); in getContentType() [all …]
|
/packages/apps/Messaging/src/com/android/messaging/mmslib/pdu/ |
D | PduPersister.java | 416 final byte[] contentType = getByteArrayFromPartColumn( in loadParts() 418 if (contentType != null) { in loadParts() 419 part.setContentType(contentType); in loadParts() 443 final String type = toIsoString(contentType); in loadParts() 779 String contentType = getPartContentType(part); in persistPart() local 784 contentType); in persistPart() 787 if (contentType != null) { in persistPart() 790 if (ContentType.IMAGE_JPG.equals(contentType)) { in persistPart() 791 contentType = ContentType.IMAGE_JPEG; in persistPart() 796 if (ContentType.TEXT_PLAIN.equals(contentType) && data != null) { in persistPart() [all …]
|
D | PduParser.java | 197 byte[] contentType = retrieveConf.getContentType(); in parse() 198 if (null == contentType) { in parse() 201 String ctTypeStr = new String(contentType); in parse() 815 byte[] contentType = in parseHeaders() 818 if (null != contentType) { in parseHeaders() 823 + Arrays.toString(contentType)); in parseHeaders() 825 headers.setTextString(contentType, PduHeaders.CONTENT_TYPE); in parseHeaders() 886 byte[] contentType = parseContentType(pduDataStream, map); in parseParts() 887 if (null != contentType) { in parseParts() 888 part.setContentType(contentType); in parseParts() [all …]
|
/packages/apps/UnifiedEmail/src/com/android/mail/utils/ |
D | MimeType.java | 59 public static boolean isViewable(Context context, Uri contentUri, String contentType) { in isViewable() argument 64 if (contentType == null || contentType.length() == 0 || in isViewable() 65 NULL_ATTACHMENT_CONTENT_TYPE.equals(contentType)) { in isViewable() 75 Utils.setIntentDataAndTypeAndNormalize(mimetypeIntent, contentUri, contentType); in isViewable() 79 Utils.setIntentDataAndTypeAndNormalize(mimetypeIntent, dummyUri, contentType); in isViewable() 97 contentType, contentUri, mimetypeIntent.getType(), mimetypeIntent.getData()); in isViewable()
|
D | AttachmentUtils.java | 98 final String contentType = attachment.getContentType(); in getDisplayType() local 99 String displayType = getMimeTypeDisplayName(context, contentType); in getDisplayType() 100 int index = !TextUtils.isEmpty(contentType) ? contentType.indexOf('/') : -1; in getDisplayType() 102 displayType = getMimeTypeDisplayName(context, contentType.substring(0, index)); in getDisplayType()
|
/packages/apps/UnifiedEmail/src/com/android/emailcommon/internet/ |
D | MimeMultipart.java | 43 public MimeMultipart(String contentType) throws MessagingException { in MimeMultipart() argument 44 this.mContentType = contentType; in MimeMultipart() 46 mSubType = MimeUtility.getHeaderParameter(contentType, null).split("/")[1]; in MimeMultipart() 47 mBoundary = MimeUtility.getHeaderParameter(contentType, "boundary"); in MimeMultipart() 49 throw new MessagingException("MultiPart does not contain boundary: " + contentType); in MimeMultipart() 54 + contentType + ")", e); in MimeMultipart()
|
D | MimeBodyPart.java | 98 String contentType = String.format("%s;\n charset=utf-8", getMimeType()); in setBody() local 101 contentType += String.format(";\n name=\"%s\"", name); in setBody() 103 setHeader(MimeHeader.HEADER_CONTENT_TYPE, contentType); in setBody() 110 String contentType = getFirstHeader(MimeHeader.HEADER_CONTENT_TYPE); in getContentType() local 111 if (contentType == null) { in getContentType() 114 return contentType; in getContentType()
|
/packages/apps/Messaging/src/com/android/messaging/ui/ |
D | AttachmentPreviewFactory.java | 68 final String contentType = attachmentData.getContentType(); in createAttachmentPreview() local 73 } else if (ContentType.isImageType(contentType)) { in createAttachmentPreview() 76 } else if (ContentType.isAudioType(contentType)) { in createAttachmentPreview() 78 } else if (ContentType.isVideoType(contentType)) { in createAttachmentPreview() 80 } else if (ContentType.isVCardType(contentType)) { in createAttachmentPreview() 83 Assert.fail("unsupported attachment type: " + contentType); in createAttachmentPreview() 130 final String contentType = attachmentData.getContentType(); in getImageRequestDescriptorForAttachment() local 131 if (ContentType.isImageType(contentType)) { in getImageRequestDescriptorForAttachment()
|
/packages/apps/Messaging/src/com/android/messaging/sms/ |
D | MmsUtils.java | 306 final String contentType = part.getContentType(); in makePduBody() local 307 if (ContentType.isImageType(contentType)) { in makePduBody() 309 } else if (ContentType.isVCardType(contentType)) { in makePduBody() 335 String contentType = part.getContentType(); in makePduBody() local 336 if (ContentType.isImageType(contentType)) { in makePduBody() 341 final boolean isGif = ImageUtils.isGif(contentType, part.getContentUri()); in makePduBody() 342 contentType = isGif ? ContentType.IMAGE_GIF : contentType; in makePduBody() 346 widthLimit, heightLimit, bytesPerImage, srcName, contentType); in makePduBody() 348 } else if (ContentType.isVideoType(contentType)) { in makePduBody() 355 } else if (ContentType.isVCardType(contentType)) { in makePduBody() [all …]
|
/packages/apps/Dialer/java/com/android/voicemail/impl/sms/ |
D | SyncMessage.java | 42 private final String contentType; field in SyncMessage 59 + contentType in toString() 71 contentType = getString(wrappedData, OmtpConstants.CONTENT_TYPE); in SyncMessage() 115 return contentType; in getContentType()
|
/packages/apps/Email/tests/src/com/android/emailcommon/internet/ |
D | Rfc822OutputTests.java | 173 Field contentType = header.getField("content-type"); in testWriteToAlternativePart() local 174 assertTrue(contentType.getBody().contains("multipart/alternative")); in testWriteToAlternativePart() 217 Field contentType = header.getField("content-type"); in testWriteToMixedPart() local 218 assertTrue(contentType.getBody().contains("multipart/mixed")); in testWriteToMixedPart() 296 Field contentType = header.getField("MIME-VERSION"); in checkMimeVersion() local 297 assertTrue(contentType.getBody().equals("1.0")); in checkMimeVersion()
|
/packages/apps/Messaging/src/com/android/messaging/ui/conversation/ |
D | ConversationFragment.java | 1300 public final String contentType; field in ConversationFragment.AttachmentToSave 1303 AttachmentToSave(final Uri uri, final String contentType) { in AttachmentToSave() argument 1305 this.contentType = contentType; in AttachmentToSave() 1314 final String contentType) { in SaveAttachmentTask() argument 1316 addAttachmentToSave(contentUri, contentType); in SaveAttachmentTask() 1323 public void addAttachmentToSave(final Uri contentUri, final String contentType) { in addAttachmentToSave() argument 1324 mAttachmentsToSave.add(new AttachmentToSave(contentUri, contentType)); in addAttachmentToSave() 1339 final boolean isImageOrVideo = ContentType.isImageType(attachment.contentType) in doInBackgroundTimed() 1340 || ContentType.isVideoType(attachment.contentType); in doInBackgroundTimed() 1342 isImageOrVideo ? appDir : downloadDir, attachment.contentType); in doInBackgroundTimed() [all …]
|
/packages/apps/Bluetooth/src/com/android/bluetooth/opp/ |
D | BluetoothOppSendFileInfo.java | 107 String contentType; in generateFileInfo() local 113 contentType = contentResolver.getType(uri); in generateFileInfo() 163 contentType = type; in generateFileInfo() 239 return new BluetoothOppSendFileInfo(fileName, contentType, length, is, 0); in generateFileInfo()
|
D | BluetoothOppManager.java | 464 String contentType = contentResolver.getType(fileUri); in insertMultipleShare() local 466 Log.v(TAG, "Got mimetype: " + contentType + " Got uri: " + fileUri); in insertMultipleShare() 468 if (TextUtils.isEmpty(contentType)) { in insertMultipleShare() 469 contentType = mTypeOfMultipleFiles; in insertMultipleShare() 472 values.put(BluetoothShare.MIMETYPE, contentType); in insertMultipleShare()
|
/packages/apps/Messaging/src/com/android/messaging/ui/mediapicker/ |
D | DocumentImagePicker.java | 129 protected void onPostExecute(final String contentType) { in prepareDocumentForAttachment() argument 130 if (contentType == null) { in prepareDocumentForAttachment() 135 PendingAttachmentData.createPendingAttachmentData(contentType, in prepareDocumentForAttachment()
|