/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 | 78 final String contentType = extractContentType(contentUri, intent.getType()); in onAttachFragment() local 82 contentUri, intent.getType(), contentType)); in onAttachFragment() 84 if (ContentType.TEXT_PLAIN.equals(contentType)) { in onAttachFragment() 91 } else if (ContentType.isImageType(contentType) || in onAttachFragment() 92 ContentType.isVCardType(contentType) || in onAttachFragment() 93 ContentType.isAudioType(contentType) || in onAttachFragment() 94 ContentType.isVideoType(contentType)) { in onAttachFragment() 97 addSharedImagePartToDraft(contentType, contentUri); in onAttachFragment() 103 Assert.fail("Unsupported shared content type for " + contentUri + ": " + contentType in onAttachFragment() 107 final String contentType = intent.getType(); in onAttachFragment() local [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/providers/ |
D | Attachment.java | 96 private String contentType; field in Attachment 178 contentType = in.readString(); in Attachment() 199 contentType = cursor.getString(cursor.getColumnIndex(AttachmentColumns.CONTENT_TYPE)); in Attachment() 220 contentType = srcJson.optString(AttachmentColumns.CONTENT_TYPE, null); in Attachment() 248 contentType = MimeType.inferMimeType(name, part.getMimeType()); in Attachment() 293 contentType = values.getAsString(AttachmentColumns.CONTENT_TYPE); in Attachment() 318 values.put(AttachmentColumns.CONTENT_TYPE, contentType); in toContentValues() 340 dest.writeString(contentType); in writeToParcel() 359 result.put(AttachmentColumns.CONTENT_TYPE, contentType); in toJSON() 473 inferredContentType = MimeType.inferMimeType(name, contentType); in getContentType() [all …]
|
/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/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/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 | 96 final String contentType = attachment.getContentType(); in getDisplayType() local 97 String displayType = getMimeTypeDisplayName(context, contentType); in getDisplayType() 98 int index = !TextUtils.isEmpty(contentType) ? contentType.indexOf('/') : -1; in getDisplayType() 100 displayType = getMimeTypeDisplayName(context, contentType.substring(0, index)); in getDisplayType()
|
/packages/apps/Bluetooth/src/com/android/bluetooth/map/ |
D | BluetoothMapbMessageMime.java | 150 private String contentType = null; field in BluetoothMapbMessageMime 281 public void setContentType(String contentType) { in setContentType() argument 282 this.contentType = contentType; in setContentType() 285 return contentType; in getContentType() 403 if(contentType != null) in encodeHeaders() 405 contentType).append("; boundary=").append(getBoundary()).append("\r\n"); in encodeHeaders() 554 contentType = contentTypeParts[0]; in parseMimeHeaders() 708 if(contentType == null) in parseMime() 709 contentType = "text/plain"; in parseMime() 710 parts.get(0).mContentType = contentType; in parseMime()
|
/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/services/Telephony/src/com/android/phone/common/mail/internet/ |
D | MimeMultipart.java | 42 public MimeMultipart(String contentType) throws MessagingException { in MimeMultipart() argument 43 this.mContentType = contentType; in MimeMultipart() 45 mSubType = MimeUtility.getHeaderParameter(contentType, null).split("/")[1]; in MimeMultipart() 46 mBoundary = MimeUtility.getHeaderParameter(contentType, "boundary"); in MimeMultipart() 48 throw new MessagingException("MultiPart does not contain boundary: " + contentType); in MimeMultipart() 53 + contentType + ")", e); in MimeMultipart()
|
D | MimeBodyPart.java | 97 String contentType = String.format("%s;\n charset=utf-8", getMimeType()); in setBody() local 100 contentType += String.format(";\n name=\"%s\"", name); in setBody() 102 setHeader(MimeHeader.HEADER_CONTENT_TYPE, contentType); in setBody() 109 String contentType = getFirstHeader(MimeHeader.HEADER_CONTENT_TYPE); in getContentType() local 110 if (contentType == null) { in getContentType() 113 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/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/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/services/Car/service/src/com/android/car/ |
D | CarAudioAttributesUtil.java | 128 private static AudioAttributes createAudioAttributes(int contentType, int usage) { in createAudioAttributes() argument 130 return builder.setContentType(contentType).setUsage(usage).build(); in createAudioAttributes() 134 int contentType, int usage) { in createCustomAudioAttributes() argument 138 return builder.setContentType(contentType).setUsage(usage).addBundle(bundle).build(); in createCustomAudioAttributes()
|
/packages/apps/Email/provider_src/com/android/email/ |
D | LegacyConversions.java | 197 final String contentType = MimeUtility.unfoldAndDecode(part.getContentType()); in mimePartToAttachment() local 199 String name = MimeUtility.getHeaderParameter(contentType, "name"); in mimePartToAttachment() 473 private static void addTextBodyPart(final MimeMultipart mp, final String contentType, in addTextBodyPart() argument 480 final MimeBodyPart bp = new MimeBodyPart(body, contentType); in addTextBodyPart() 495 protected static void addAttachmentPart(final Multipart mp, final String contentType, in addAttachmentPart() argument 499 final MimeBodyPart bp = new MimeBodyPart(body, contentType); in addAttachmentPart()
|
/packages/apps/Bluetooth/src/com/android/bluetooth/opp/ |
D | BluetoothOppSendFileInfo.java | 105 String contentType; in generateFileInfo() local 111 contentType = contentResolver.getType(uri); in generateFileInfo() 140 contentType = type; in generateFileInfo() 213 return new BluetoothOppSendFileInfo(fileName, contentType, length, is, 0); in generateFileInfo()
|