Home
last modified time | relevance | path

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

1234

/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 …]
/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/
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()
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()
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/modules/Wifi/framework/java/android/net/wifi/hotspot2/
DConfigParser.java89 public String contentType = null; field in ConfigParser.MimeHeader
228 if (!TextUtils.equals(header.contentType, TYPE_MULTIPART_MIXED)) { in parseMimeMultipartMessage()
229 throw new IOException("Invalid content type: " + header.contentType); in parseMimeMultipartMessage()
279 if (!TextUtils.equals(header.contentType, TYPE_PASSPOINT_PROFILE) && in parseMimePart()
280 !TextUtils.equals(header.contentType, TYPE_CA_CERT) && in parseMimePart()
281 !TextUtils.equals(header.contentType, TYPE_PKCS12)) { in parseMimePart()
282 throw new IOException("Unexpected content type: " + header.contentType); in parseMimePart()
305 part.type = header.contentType; in parseMimePart()
329 header.contentType = value.first; in parseHeaders()
354 private static Pair<String, String> parseContentType(String contentType) throws IOException { in parseContentType() argument
[all …]
/packages/modules/Wifi/service/java/com/android/server/wifi/entitlement/http/
DHttpConstants.java58 public static int getContentType(@NonNull String contentType) { in getContentType() argument
59 if (contentType.contains("xml")) { in getContentType()
62 if ("text/vnd.wap.connectivity".equals(contentType)) { in getContentType()
66 if (contentType.contains("json")) { in getContentType()
DHttpResponse.java34 public abstract int contentType(); in contentType() method in HttpResponse
67 public abstract Builder setContentType(int contentType); in setContentType() argument
109 .append(contentType()) in toShortDebugString()
/packages/apps/Messaging/src/com/android/messaging/mmslib/pdu/
DPduPersister.java417 final byte[] contentType = getByteArrayFromPartColumn( in loadParts()
419 if (contentType != null) { in loadParts()
420 part.setContentType(contentType); in loadParts()
444 final String type = toIsoString(contentType); in loadParts()
780 String contentType = getPartContentType(part); in persistPart() local
785 contentType); in persistPart()
788 if (contentType != null) { in persistPart()
791 if (ContentType.IMAGE_JPG.equals(contentType)) { in persistPart()
792 contentType = ContentType.IMAGE_JPEG; in persistPart()
797 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 …]
/packages/modules/Bluetooth/android/app/src/com/android/bluetooth/avrcpcontroller/bip/
DBipAttachmentFormat.java62 String contentType, in BipAttachmentFormat() argument
68 if (contentType == null) { in BipAttachmentFormat()
75 mContentType = contentType; in BipAttachmentFormat()
98 String contentType, in BipAttachmentFormat() argument
104 mContentType = Objects.requireNonNull(contentType, "Content-Type cannot be null"); in BipAttachmentFormat()
/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/
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/modules/IntentResolver/java/src/com/android/intentresolver/contentpreview/payloadtoggle/ui/viewmodel/
DShareouselViewModel.kt92 ) { contentType, numItems -> in <lambda>() method
93 when (contentType) { in <lambda>()
120 val contentType = in <lambda>() constant
139 contentType = contentType, in <lambda>()
/packages/modules/Bluetooth/android/app/tests/unit/src/com/android/bluetooth/avrcpcontroller/bip/
DBipAttachmentFormatTest.java48 String contentType, in testParse() argument
60 new BipAttachmentFormat(contentType, charset, name, size, created, modified); in testParse()
61 Assert.assertEquals(contentType, attachment.getContentType()); in testParse()
82 String contentType, in testCreate() argument
89 new BipAttachmentFormat(contentType, charset, name, size, created, modified); in testCreate()
90 Assert.assertEquals(contentType, attachment.getContentType()); in testCreate()
/packages/services/Car/service/src/com/android/car/audio/
DCarDuckingInfo.java88 (playbackTrackMetaData.contentType != UNKNOWN in dump()
89 ? playbackTrackMetaData.contentType in dump()
116 if (playbackTrackMetaData.contentType != UNKNOWN) { in dumpProto()
118 playbackTrackMetaData.contentType); in dumpProto()
/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/modules/RemoteKeyProvisioning/app/src/com/android/rkpdapp/interfaces/
DServerInterface.java332 final String contentType = con.getContentType(); in readErrorFromConnection() local
333 if (!contentType.startsWith("text") && !contentType.startsWith("application/json")) { in readErrorFromConnection()
334 return "Unexpected content type from the server: " + contentType; in readErrorFromConnection()
360 final Charset charset = getCharsetFromContentTypeHeader(contentType); in readErrorFromConnection()
387 private static Charset getCharsetFromContentTypeHeader(String contentType) { in getCharsetFromContentTypeHeader() argument
388 final String[] contentTypeParts = contentType.split(";"); in getCharsetFromContentTypeHeader()
/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/services/Car/tests/carservice_unit_test/src/com/android/car/audio/
DCarHalAudioUtilsTest.java157 .that(metadata.contentType).isEqualTo(CONTENT_TYPE_MUSIC); in audioAttributeToMetadata_succeeds()
169 .that(metadata.contentType).isEqualTo(CONTENT_TYPE_SPEECH); in audioAttributeToMetadata_withOemTags_succeeds()
190 .that(metadata.contentType).isEqualTo(CONTENT_TYPE_UNKNOWN); in audioAttributesWrapperToMetadata_succeeds()
205 .that(metadata.contentType).isEqualTo(CONTENT_TYPE_UNKNOWN); in usageToMetadata_succeeds()
228 metadata.contentType = CONTENT_TYPE_MUSIC; in metadataToAudioAttribute_withMusic_succeeds()
248 metadata.contentType = CONTENT_TYPE_UNKNOWN; in metadataToAudioAttribute_withSystemUsage_succeeds()
268 metadata.contentType = CONTENT_TYPE_SPEECH; in metadataToAudioAttributes_withOemTags_succeeds()

1234