Lines Matching defs:part

82         "content://mms/" + Long.MAX_VALUE + "/part";
362 Uri.parse("content://mms/" + msgId + "/part"),
370 Log.v(TAG, "loadParts(" + msgId + "): no part to load.");
379 PduPart part = new PduPart();
383 part.setCharset(charset);
389 part.setContentDisposition(contentDisposition);
395 part.setContentId(contentId);
401 part.setContentLocation(contentLocation);
407 part.setContentType(contentType);
415 part.setFilename(fileName);
421 part.setName(name);
424 // Construct a Uri for this part.
426 Uri partURI = Uri.parse("content://mms/part/" + partId);
427 part.setDataUri(partURI);
459 Log.e(TAG, "Failed to load part data", e);
472 part.setData(baos.toByteArray());
474 parts[partIdx++] = part;
700 private static String getPartContentType(PduPart part) {
701 return part.getContentType() == null ? null : toIsoString(part.getContentType());
704 public Uri persistPart(PduPart part, long msgId, HashMap<Uri, InputStream> preOpenedFiles)
706 Uri uri = Uri.parse("content://mms/" + msgId + "/part");
709 int charset = part.getCharset();
714 String contentType = getPartContentType(part);
723 // To ensure the SMIL part is always the first part.
728 throw new MmsException("MIME type of the part must be set.");
731 if (part.getFilename() != null) {
732 String fileName = new String(part.getFilename());
736 if (part.getName() != null) {
737 String name = new String(part.getName());
742 if (part.getContentDisposition() != null) {
743 value = toIsoString(part.getContentDisposition());
747 if (part.getContentId() != null) {
748 value = toIsoString(part.getContentId());
752 if (part.getContentLocation() != null) {
753 value = toIsoString(part.getContentLocation());
759 throw new MmsException("Failed to persist part, return null.");
762 persistData(part, res, contentType, preOpenedFiles);
764 // the dataUri of the part.
765 part.setDataUri(res);
771 * Save data of the part into storage. The source data may be given
777 * @param part The PDU part which contains data to be saved.
778 * @param uri The URI of the part.
779 * @param contentType The MIME type of the part.
784 private void persistData(PduPart part, Uri uri,
794 byte[] data = part.getData();
826 Log.e(TAG, "Can't get file info for: " + part.getDataUri(), e);
837 // content://mms/part/98
840 dataUri = part.getDataUri();
842 Log.w(TAG, "Can't find data for this part.");
912 // Reset the permissions on the encrypted part file so everyone has only read
1092 private void updatePart(Uri uri, PduPart part, HashMap<Uri, InputStream> preOpenedFiles)
1096 int charset = part.getCharset();
1102 if (part.getContentType() != null) {
1103 contentType = toIsoString(part.getContentType());
1106 throw new MmsException("MIME type of the part must be set.");
1109 if (part.getFilename() != null) {
1110 String fileName = new String(part.getFilename());
1114 if (part.getName() != null) {
1115 String name = new String(part.getName());
1120 if (part.getContentDisposition() != null) {
1121 value = toIsoString(part.getContentDisposition());
1125 if (part.getContentId() != null) {
1126 value = toIsoString(part.getContentId());
1130 if (part.getContentLocation() != null) {
1131 value = toIsoString(part.getContentLocation());
1139 // 2. The Uri of the part is different from the current one.
1140 if ((part.getData() != null)
1141 || (uri != part.getDataUri())) {
1142 persistData(part, uri, contentType, preOpenedFiles);
1184 PduPart part = body.getPart(i);
1185 Uri partUri = part.getDataUri();
1187 toBeCreated.add(part);
1189 toBeUpdated.put(partUri, part);
1208 Uri.parse(Mms.CONTENT_URI + "/" + msgId + "/part"),
1212 for (PduPart part : toBeCreated) {
1213 persistPart(part, msgId, preOpenedFiles);
1401 PduPart part = body.getPart(i);
1402 messageSize += part.getDataLength();
1403 persistPart(part, dummyId, preOpenedFiles);
1405 // If we've got anything besides text/plain or SMIL part, then we've got
1407 String contentType = getPartContentType(part);
1441 Uri.parse("content://mms/" + dummyId + "/part"),