Lines Matching defs:part

81         "content://mms/" + Long.MAX_VALUE + "/part";
358 Uri.parse("content://mms/" + msgId + "/part"),
366 Log.v(TAG, "loadParts(" + msgId + "): no part to load.");
375 PduPart part = new PduPart();
379 part.setCharset(charset);
385 part.setContentDisposition(contentDisposition);
391 part.setContentId(contentId);
397 part.setContentLocation(contentLocation);
403 part.setContentType(contentType);
411 part.setFilename(fileName);
417 part.setName(name);
420 // Construct a Uri for this part.
422 Uri partURI = Uri.parse("content://mms/part/" + partId);
423 part.setDataUri(partURI);
455 Log.e(TAG, "Failed to load part data", e);
468 part.setData(baos.toByteArray());
470 parts[partIdx++] = part;
696 private static String getPartContentType(PduPart part) {
697 return part.getContentType() == null ? null : toIsoString(part.getContentType());
700 public Uri persistPart(PduPart part, long msgId, HashMap<Uri, InputStream> preOpenedFiles)
702 Uri uri = Uri.parse("content://mms/" + msgId + "/part");
705 int charset = part.getCharset();
710 String contentType = getPartContentType(part);
719 // To ensure the SMIL part is always the first part.
724 throw new MmsException("MIME type of the part must be set.");
727 if (part.getFilename() != null) {
728 String fileName = new String(part.getFilename());
732 if (part.getName() != null) {
733 String name = new String(part.getName());
738 if (part.getContentDisposition() != null) {
739 value = toIsoString(part.getContentDisposition());
743 if (part.getContentId() != null) {
744 value = toIsoString(part.getContentId());
748 if (part.getContentLocation() != null) {
749 value = toIsoString(part.getContentLocation());
755 throw new MmsException("Failed to persist part, return null.");
758 persistData(part, res, contentType, preOpenedFiles);
760 // the dataUri of the part.
761 part.setDataUri(res);
767 * Save data of the part into storage. The source data may be given
773 * @param part The PDU part which contains data to be saved.
774 * @param uri The URI of the part.
775 * @param contentType The MIME type of the part.
780 private void persistData(PduPart part, Uri uri,
790 byte[] data = part.getData();
819 Log.e(TAG, "Can't get file info for: " + part.getDataUri(), e);
830 // content://mms/part/98
833 dataUri = part.getDataUri();
835 Log.w(TAG, "Can't find data for this part.");
905 // Reset the permissions on the encrypted part file so everyone has only read
1085 private void updatePart(Uri uri, PduPart part, HashMap<Uri, InputStream> preOpenedFiles)
1089 int charset = part.getCharset();
1095 if (part.getContentType() != null) {
1096 contentType = toIsoString(part.getContentType());
1099 throw new MmsException("MIME type of the part must be set.");
1102 if (part.getFilename() != null) {
1103 String fileName = new String(part.getFilename());
1107 if (part.getName() != null) {
1108 String name = new String(part.getName());
1113 if (part.getContentDisposition() != null) {
1114 value = toIsoString(part.getContentDisposition());
1118 if (part.getContentId() != null) {
1119 value = toIsoString(part.getContentId());
1123 if (part.getContentLocation() != null) {
1124 value = toIsoString(part.getContentLocation());
1132 // 2. The Uri of the part is different from the current one.
1133 if ((part.getData() != null)
1134 || (uri != part.getDataUri())) {
1135 persistData(part, uri, contentType, preOpenedFiles);
1177 PduPart part = body.getPart(i);
1178 Uri partUri = part.getDataUri();
1180 toBeCreated.add(part);
1182 toBeUpdated.put(partUri, part);
1201 Uri.parse(Mms.CONTENT_URI + "/" + msgId + "/part"),
1205 for (PduPart part : toBeCreated) {
1206 persistPart(part, msgId, preOpenedFiles);
1386 PduPart part = body.getPart(i);
1387 persistPart(part, dummyId, preOpenedFiles);
1389 // If we've got anything besides text/plain or SMIL part, then we've got
1391 String contentType = getPartContentType(part);
1420 Uri.parse("content://mms/" + dummyId + "/part"),