Exemplo n.º 1
0
  private PduPart getPart(Cursor cursor) {
    PduPart part = new PduPart();

    getPartValues(part, cursor);

    part.setDataUri(PartAuthority.getPartUri(part.getPartId()));

    return part;
  }
Exemplo n.º 2
0
 private Pair<File, Long> writePartData(MasterSecret masterSecret, PduPart part)
     throws MmsException {
   try {
     if (part.getData() != null) {
       Log.w(TAG, "Writing part data from buffer");
       return writePartData(masterSecret, part, new ByteArrayInputStream(part.getData()));
     } else if (part.getDataUri() != null) {
       Log.w(TAG, "Writing part data from URI");
       InputStream in = PartAuthority.getPartStream(context, masterSecret, part.getDataUri());
       return writePartData(masterSecret, part, in);
     } else {
       throw new MmsException("Part is empty!");
     }
   } catch (IOException e) {
     throw new MmsException(e);
   }
 }
Exemplo n.º 3
0
 public Uri getUri() {
   return PartAuthority.getPartUri(partId);
 }