Home
last modified time | relevance | path

Searched refs:contentType (Results 1 – 25 of 48) sorted by relevance

12

/packages/apps/Messaging/src/com/android/messaging/util/
DContentType.java104 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 …]
DImageUtils.java227 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 …]
DFileUtil.java63 public static File getNewFile(File directory, String contentType) throws IOException { in getNewFile() argument
64 String fileExtension = ContentType.getExtensionFromMimeType(contentType); in getNewFile()
66 String fileNameFormat = context.getString(ContentType.isImageType(contentType) in getNewFile()
/packages/apps/Messaging/src/android/support/v7/mms/pdu/
DContentType.java169 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 …]
DPduParser.java172 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/Dialer/java/com/android/voicemail/impl/mail/internet/
DMimeMultipart.java30 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()
DMimeBodyPart.java93 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/
DPendingAttachmentData.java57 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()
DMediaPickerMessagePartData.java25 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()
DMessagePartData.java133 protected MessagePartData(final String contentType, final Uri contentUri, in MessagePartData() argument
135 this(null, null, contentType, contentUri, width, height, false /*singlePartOnly*/); in MessagePartData()
141 protected MessagePartData(final String messageText, final String contentType, in MessagePartData() argument
143 this(null, messageText, contentType, contentUri, width, height, false /*singlePartOnly*/); in MessagePartData()
149 protected MessagePartData(final String messageText, final String contentType, in MessagePartData() argument
151 this(null, messageText, contentType, contentUri, width, height, singlePartOnly); in MessagePartData()
158 final String contentType, final Uri contentUri, final int width, final int height, in MessagePartData() argument
162 mContentType = contentType; in MessagePartData()
179 public static MessagePartData createMediaMessagePart(final String contentType, in createMediaMessagePart() argument
181 return new MessagePartData(contentType, contentUri, width, height); in createMediaMessagePart()
[all …]
/packages/apps/Messaging/src/com/android/messaging/ui/conversationlist/
DShareIntentActivity.java98 final String contentType = extractContentType(contentUri, intent.getType()); in onAttachFragment() local
102 contentUri, intent.getType(), contentType)); in onAttachFragment()
104 if (ContentType.TEXT_PLAIN.equals(contentType)) { in onAttachFragment()
115 } else if (PendingAttachmentData.isSupportedMediaType(contentType)) { in onAttachFragment()
118 addSharedPartToDraft(contentType, contentUri); in onAttachFragment()
125 + ": " + contentType + " (" + intent.getType() + ")"); in onAttachFragment()
129 final String contentType = intent.getType(); in onAttachFragment() local
141 final String actualContentType = extractContentType(uri, contentType); in onAttachFragment()
212 private static String extractContentType(final Uri uri, final String contentType) { in extractContentType() argument
214 return contentType; in extractContentType()
[all …]
/packages/apps/Messaging/src/com/android/messaging/mmslib/pdu/
DPduPersister.java416 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 …]
DPduParser.java197 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 …]
DPduPart.java282 public void setContentType(final byte[] contentType) { in setContentType() argument
283 if (contentType == null) { in setContentType()
287 mPartHeader.put(P_CONTENT_TYPE, contentType); in setContentType()
/packages/apps/Messaging/src/com/android/messaging/ui/
DAttachmentPreviewFactory.java68 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/Bluetooth/src/com/android/bluetooth/avrcpcontroller/bip/
DBipAttachmentFormat.java70 public BipAttachmentFormat(String contentType, String charset, String name, String size, in BipAttachmentFormat() argument
72 if (contentType == null) { in BipAttachmentFormat()
79 mContentType = contentType; in BipAttachmentFormat()
101 public BipAttachmentFormat(String contentType, String charset, String name, int size, in BipAttachmentFormat() argument
103 mContentType = Objects.requireNonNull(contentType, "Content-Type cannot be null"); in BipAttachmentFormat()
DBipImageProperties.java192 String contentType = xpp.getAttributeValue(null, "content-type"); in parse() local
199 new BipAttachmentFormat(contentType, charset, name, size, in parse()
313 String contentType = format.getContentType(); in toString() local
319 if (contentType == null || name == null) { in toString()
324 xmlMsgElement.attribute(null, "content-type", contentType.toString()); in toString()
/packages/apps/Messaging/src/com/android/messaging/sms/
DMmsUtils.java304 final String contentType = part.getContentType(); in makePduBody() local
305 if (ContentType.isImageType(contentType)) { in makePduBody()
307 } else if (ContentType.isVCardType(contentType)) { in makePduBody()
333 String contentType = part.getContentType(); in makePduBody() local
334 final String extension = ContentType.getExtensionFromMimeType(contentType); in makePduBody()
335 if (ContentType.isImageType(contentType)) { in makePduBody()
343 final boolean isGif = ImageUtils.isGif(contentType, part.getContentUri()); in makePduBody()
344 contentType = isGif ? ContentType.IMAGE_GIF : contentType; in makePduBody()
349 widthLimit, heightLimit, bytesPerImage, srcName, contentType); in makePduBody()
351 } else if (ContentType.isVideoType(contentType)) { in makePduBody()
[all …]
/packages/apps/Bluetooth/tests/unit/src/com/android/bluetooth/avrcpcontroller/bip/
DBipAttachmentFormatTest.java49 private void testParse(String contentType, String charset, String name, String size, in testParse() argument
53 BipAttachmentFormat attachment = new BipAttachmentFormat(contentType, charset, name, in testParse()
55 Assert.assertEquals(contentType, attachment.getContentType()); in testParse()
75 private void testCreate(String contentType, String charset, String name, int size, in testCreate() argument
77 BipAttachmentFormat attachment = new BipAttachmentFormat(contentType, charset, name, in testCreate()
79 Assert.assertEquals(contentType, attachment.getContentType()); in testCreate()
/packages/apps/Dialer/java/com/android/voicemail/impl/sms/
DSyncMessage.java42 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/Messaging/src/com/android/messaging/ui/conversation/
DConversationFragment.java1310 public final String contentType; field in ConversationFragment.AttachmentToSave
1313 AttachmentToSave(final Uri uri, final String contentType) { in AttachmentToSave() argument
1315 this.contentType = contentType; in AttachmentToSave()
1324 final String contentType) { in SaveAttachmentTask() argument
1326 addAttachmentToSave(contentUri, contentType); in SaveAttachmentTask()
1333 public void addAttachmentToSave(final Uri contentUri, final String contentType) { in addAttachmentToSave() argument
1334 mAttachmentsToSave.add(new AttachmentToSave(contentUri, contentType)); in addAttachmentToSave()
1349 final boolean isImageOrVideo = ContentType.isImageType(attachment.contentType) in doInBackgroundTimed()
1350 || ContentType.isVideoType(attachment.contentType); in doInBackgroundTimed()
1352 isImageOrVideo ? appDir : downloadDir, attachment.contentType); in doInBackgroundTimed()
[all …]
/packages/apps/Bluetooth/src/com/android/bluetooth/opp/
DBluetoothOppSendFileInfo.java107 String contentType; in generateFileInfo() local
113 contentType = contentResolver.getType(uri); in generateFileInfo()
163 contentType = type; in generateFileInfo()
241 return new BluetoothOppSendFileInfo(fileName, contentType, length, is, 0); in generateFileInfo()
DBluetoothOppManager.java464 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/
DDocumentImagePicker.java125 protected void onPostExecute(final String contentType) { in prepareDocumentForAttachment() argument
126 if (contentType == null) { in prepareDocumentForAttachment()
131 PendingAttachmentData.createPendingAttachmentData(contentType, in prepareDocumentForAttachment()
/packages/apps/Gallery2/src/com/android/gallery3d/app/
DGalleryActivity.java165 String contentType = getContentType(intent); in startViewAction() local
166 if (contentType == null) { in startViewAction()
178 } else if (contentType.startsWith( in startViewAction()
205 Path itemPath = dm.findPathByUri(uri, contentType); in startViewAction()

12