• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java RetrieveConf类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中ws.com.google.android.mms.pdu.RetrieveConf的典型用法代码示例。如果您正苦于以下问题:Java RetrieveConf类的具体用法?Java RetrieveConf怎么用?Java RetrieveConf使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



RetrieveConf类属于ws.com.google.android.mms.pdu包,在下文中一共展示了RetrieveConf类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: retrieve

import ws.com.google.android.mms.pdu.RetrieveConf; //导入依赖的package包/类
@Nullable
@Override
public RetrieveConf retrieve(@NonNull String contentLocation,
                             byte[] transactionId,
                             int subscriptionId)
    throws MmsException, MmsRadioException, ApnUnavailableException, IOException
{
  if (VERSION.SDK_INT < 22 || subscriptionId == -1) {
    Log.w(TAG, "Receiving via legacy connection");
    try {
      return new IncomingLegacyMmsConnection(context).retrieve(contentLocation, transactionId, subscriptionId);
    } catch (MmsRadioException | ApnUnavailableException | IOException e) {
      Log.w(TAG, e);
    }
  }

  if (VERSION.SDK_INT >= VERSION_CODES.LOLLIPOP) {
    Log.w(TAG, "Falling back to try receiving via Lollipop API");
    return new IncomingLollipopMmsConnection(context).retrieve(contentLocation, transactionId, subscriptionId);
  } else {
    throw new IOException("Not able to use Lollipop APIs, giving up...");
  }
}
 
开发者ID:XecureIT,项目名称:PeSanKita-android,代码行数:24,代码来源:CompatMmsConnection.java


示例2: retrieveAndStore

import ws.com.google.android.mms.pdu.RetrieveConf; //导入依赖的package包/类
private void retrieveAndStore(MasterSecret masterSecret, MmsRadio radio,
                              long messageId, long threadId,
                              String contentLocation, byte[] transactionId,
                              boolean radioEnabled, boolean useProxy)
    throws IOException, MmsException, ApnUnavailableException,
           DuplicateMessageException, NoSessionException,
           InvalidMessageException, LegacyMessageException
{
  Apn                   dbApn      = MmsConnection.getApn(context, radio.getApnInformation());
  Apn                   contentApn = new Apn(contentLocation, dbApn.getProxy(), Integer.toString(dbApn.getPort()), dbApn.getUsername(), dbApn.getPassword());
  IncomingMmsConnection connection = new IncomingMmsConnection(context, contentApn);
  RetrieveConf          retrieved  = connection.retrieve(radioEnabled, useProxy);

  storeRetrievedMms(masterSecret, contentLocation, messageId, threadId, retrieved);
  sendRetrievedAcknowledgement(radio, transactionId, radioEnabled, useProxy);
}
 
开发者ID:redcracker,项目名称:TextSecure,代码行数:17,代码来源:MmsDownloadJob.java


示例3: retrieve

import ws.com.google.android.mms.pdu.RetrieveConf; //导入依赖的package包/类
@Nullable @Override public RetrieveConf retrieve(@NonNull String contentLocation,
                                                 byte[] transactionId)
    throws MmsException, MmsRadioException, ApnUnavailableException, IOException
{
  try {
    Log.w(TAG, "Receiving via legacy connection");
    return new IncomingLegacyMmsConnection(context).retrieve(contentLocation, transactionId);
  } catch (MmsRadioException | IOException | ApnUnavailableException e) {
    if (VERSION.SDK_INT >= VERSION_CODES.LOLLIPOP) {
      Log.w(TAG, "Falling back to try receiving via Lollipop API");
      return new IncomingLollipopMmsConnection(context).retrieve(contentLocation, transactionId);
    } else {
      throw e;
    }
  }
}
 
开发者ID:Agilitum,项目名称:TextSecureSMP,代码行数:17,代码来源:CompatMmsConnection.java


示例4: storeRetrievedMms

import ws.com.google.android.mms.pdu.RetrieveConf; //导入依赖的package包/类
private void storeRetrievedMms(MasterSecret masterSecret, String contentLocation,
                               long messageId, long threadId, RetrieveConf retrieved)
    throws MmsException, NoSessionException, DuplicateMessageException, InvalidMessageException,
           LegacyMessageException
{
  MmsDatabase          database = DatabaseFactory.getMmsDatabase(context);
  IncomingMediaMessage message  = new IncomingMediaMessage(retrieved);

  Pair<Long, Long> messageAndThreadId;

  if (retrieved.getSubject() != null && WirePrefix.isEncryptedMmsSubject(retrieved.getSubject().getString())) {
    database.markAsLegacyVersion(messageId, threadId);
    messageAndThreadId = new Pair<>(messageId, threadId);
  } else {
    messageAndThreadId = database.insertMessageInbox(masterSecret, message,
                                                     contentLocation, threadId);
    database.delete(messageId);
  }

  MessageNotifier.updateNotification(context, masterSecret, messageAndThreadId.second);
}
 
开发者ID:Agilitum,项目名称:TextSecureSMP,代码行数:22,代码来源:MmsDownloadJob.java


示例5: retrieve

import ws.com.google.android.mms.pdu.RetrieveConf; //导入依赖的package包/类
@Nullable
@Override
public RetrieveConf retrieve(@NonNull String contentLocation,
                             byte[] transactionId,
                             int subscriptionId)
    throws MmsException, MmsRadioException, ApnUnavailableException, IOException
{
  if (VERSION.SDK_INT >= VERSION_CODES.LOLLIPOP) {
    Log.w(TAG, "Receiving via Lollipop API");
    return new IncomingLollipopMmsConnection(context).retrieve(contentLocation, transactionId, subscriptionId);
  } else {
    try {
      Log.w(TAG, "Receiving via legacy connection");
      return new IncomingLegacyMmsConnection(context).retrieve(contentLocation, transactionId, subscriptionId);
    } catch (MmsRadioException | IOException | ApnUnavailableException e) {
      throw e;
    }
  }
}
 
开发者ID:SilenceIM,项目名称:Silence,代码行数:20,代码来源:CompatMmsConnection.java


示例6: retrieveAndStore

import ws.com.google.android.mms.pdu.RetrieveConf; //导入依赖的package包/类
private void retrieveAndStore(MasterSecret masterSecret, MmsRadio radio,
                              long messageId, long threadId,
                              String contentLocation, byte[] transactionId,
                              boolean radioEnabled, boolean useProxy)
    throws IOException, MmsException, ApnUnavailableException,
           DuplicateMessageException, NoSessionException,
           InvalidMessageException, LegacyMessageException
{
  Apn                   dbApn      = MmsConnection.getApn(context, radio.getApnInformation());
  Apn                   contentApn = new Apn(contentLocation, dbApn.getProxy(), Integer.toString(dbApn.getPort()));
  IncomingMmsConnection connection = new IncomingMmsConnection(context, contentApn);
  RetrieveConf          retrieved  = connection.retrieve(radioEnabled, useProxy);

  storeRetrievedMms(masterSecret, contentLocation, messageId, threadId, retrieved);
  sendRetrievedAcknowledgement(radio, transactionId, radioEnabled, useProxy);
}
 
开发者ID:Securecom,项目名称:Securecom-Messaging,代码行数:17,代码来源:MmsDownloadJob.java


示例7: storeRetrievedMms

import ws.com.google.android.mms.pdu.RetrieveConf; //导入依赖的package包/类
private void storeRetrievedMms(MasterSecret masterSecret, String contentLocation,
                               long messageId, long threadId, RetrieveConf retrieved)
    throws MmsException
{
  MmsDatabase          database = DatabaseFactory.getMmsDatabase(context);
  IncomingMediaMessage message  = new IncomingMediaMessage(retrieved);

  Pair<Long, Long> messageAndThreadId;

  if (retrieved.getSubject() != null && WirePrefix.isEncryptedMmsSubject(retrieved.getSubject().getString())) {
    messageAndThreadId = database.insertSecureMessageInbox(masterSecret, message,
                                                           contentLocation, threadId);

    if (masterSecret != null)
      DecryptingQueue.scheduleDecryption(context, masterSecret, messageAndThreadId.first,
                                         messageAndThreadId.second, retrieved);

  } else {
    messageAndThreadId = database.insertMessageInbox(masterSecret, message,
                                                     contentLocation, threadId);
  }

  database.delete(messageId);
  MessageNotifier.updateNotification(context, masterSecret, messageAndThreadId.second);
}
 
开发者ID:Securecom,项目名称:Securecom-Text,代码行数:26,代码来源:MmsDownloader.java


示例8: retrieve

import ws.com.google.android.mms.pdu.RetrieveConf; //导入依赖的package包/类
public RetrieveConf retrieve(Apn contentApn, byte[] transactionId, boolean usingMmsRadio, boolean useProxyIfAvailable)
    throws IOException, ApnUnavailableException
{
  byte[] pdu = null;

  final boolean useProxy   = useProxyIfAvailable && contentApn.hasProxy();
  final String  targetHost = useProxy
                           ? contentApn.getProxy()
                           : Uri.parse(contentApn.getMmsc()).getHost();
  if (checkRouteToHost(context, targetHost, usingMmsRadio)) {
    Log.w(TAG, "got successful route to host " + targetHost);
    pdu = execute(constructRequest(contentApn, useProxy));
  }

  if (pdu == null) {
    throw new IOException("Connection manager could not obtain route to host.");
  }

  RetrieveConf retrieved = (RetrieveConf)new PduParser(pdu).parse();

  if (retrieved == null) {
    Log.w(TAG, "Couldn't parse PDU, byte response: " + Arrays.toString(pdu));
    Log.w(TAG, "Couldn't parse PDU, ASCII:         " + new String(pdu));
    throw new IOException("Bad retrieved PDU");
  }

  sendRetrievedAcknowledgement(transactionId, usingMmsRadio, useProxy);
  return retrieved;
}
 
开发者ID:XecureIT,项目名称:PeSanKita-android,代码行数:30,代码来源:IncomingLegacyMmsConnection.java


示例9: retrieve

import ws.com.google.android.mms.pdu.RetrieveConf; //导入依赖的package包/类
public RetrieveConf retrieve(boolean usingMmsRadio, boolean useProxyIfAvailable)
    throws IOException, ApnUnavailableException
{
  byte[] pdu = null;

  final boolean useProxy   = useProxyIfAvailable && apn.hasProxy();
  final String  targetHost = useProxy
                           ? apn.getProxy()
                           : Uri.parse(apn.getMmsc()).getHost();
  try {
    if (checkRouteToHost(context, targetHost, usingMmsRadio)) {
      Log.w(TAG, "got successful route to host " + targetHost);
      pdu = makeRequest(useProxy);
    }
  } catch (IOException ioe) {
    Log.w(TAG, ioe);
  }

  if (pdu == null) {
    throw new IOException("Connection manager could not obtain route to host.");
  }

  RetrieveConf retrieved = (RetrieveConf)new PduParser(pdu).parse();

  if (retrieved == null) {
    Log.w(TAG, "Couldn't parse PDU, byte response: " + Arrays.toString(pdu));
    Log.w(TAG, "Couldn't parse PDU, ASCII:         " + new String(pdu));
    throw new IOException("Bad retrieved PDU");
  }

  return retrieved;
}
 
开发者ID:redcracker,项目名称:TextSecure,代码行数:33,代码来源:IncomingMmsConnection.java


示例10: storeRetrievedMms

import ws.com.google.android.mms.pdu.RetrieveConf; //导入依赖的package包/类
private void storeRetrievedMms(MasterSecret masterSecret, String contentLocation,
                                 long messageId, long threadId, RetrieveConf retrieved)
      throws MmsException, NoSessionException, DuplicateMessageException, InvalidMessageException,
             LegacyMessageException
  {
    MmsDatabase          database = DatabaseFactory.getMmsDatabase(context);
    IncomingMediaMessage message  = new IncomingMediaMessage(retrieved);

    Pair<Long, Long> messageAndThreadId;

    if (retrieved.getSubject() != null && WirePrefix.isEncryptedMmsSubject(retrieved.getSubject().getString())) {
      MmsCipher            mmsCipher          = new MmsCipher(new TextSecureAxolotlStore(context, masterSecret));
      MultimediaMessagePdu plaintextPdu       = mmsCipher.decrypt(context, retrieved);
      RetrieveConf         plaintextRetrieved = new RetrieveConf(plaintextPdu.getPduHeaders(), plaintextPdu.getBody());
      IncomingMediaMessage plaintextMessage   = new IncomingMediaMessage(plaintextRetrieved);

      messageAndThreadId = database.insertSecureDecryptedMessageInbox(masterSecret, plaintextMessage,
                                                                      threadId);

//      if (masterSecret != null)
//        DecryptingQueue.scheduleDecryption(context, masterSecret, messageAndThreadId.first,
//                                           messageAndThreadId.second, retrieved);

    } else {
      messageAndThreadId = database.insertMessageInbox(masterSecret, message,
                                                       contentLocation, threadId);
    }

    database.delete(messageId);
    MessageNotifier.updateNotification(context, masterSecret, messageAndThreadId.second);
  }
 
开发者ID:redcracker,项目名称:TextSecure,代码行数:32,代码来源:MmsDownloadJob.java


示例11: retrieve

import ws.com.google.android.mms.pdu.RetrieveConf; //导入依赖的package包/类
@Override
@TargetApi(VERSION_CODES.LOLLIPOP)
public synchronized @Nullable RetrieveConf retrieve(@NonNull String contentLocation,
                                                    byte[] transactionId) throws MmsException
{
  beginTransaction();

  try {
    MmsBodyProvider.Pointer pointer = MmsBodyProvider.makeTemporaryPointer(getContext());

    Log.w(TAG, "downloading multimedia from " + contentLocation + " to " + pointer.getUri());
    SmsManager.getDefault().downloadMultimediaMessage(getContext(),
                                                      contentLocation,
                                                      pointer.getUri(),
                                                      null,
                                                      getPendingIntent());

    waitForResult();

    ByteArrayOutputStream baos = new ByteArrayOutputStream();
    Util.copy(pointer.getInputStream(), baos);
    pointer.close();

    Log.w(TAG, baos.size() + "-byte response: " + Hex.dump(baos.toByteArray()));

    return (RetrieveConf) new PduParser(baos.toByteArray()).parse();
  } catch (IOException | TimeoutException e) {
    Log.w(TAG, e);
    throw new MmsException(e);
  } finally {
    endTransaction();
  }
}
 
开发者ID:Agilitum,项目名称:TextSecureSMP,代码行数:34,代码来源:IncomingLollipopMmsConnection.java


示例12: retrieveAndStore

import ws.com.google.android.mms.pdu.RetrieveConf; //导入依赖的package包/类
private void retrieveAndStore(MasterSecret masterSecret, long messageId, long threadId,
                              String contentLocation, byte[] transactionId,
                              boolean radioEnabled, boolean useProxy)
    throws IOException, MmsException, ApnUnavailableException
{
  RetrieveConf retrieved = MmsDownloadHelper.retrieveMms(context, contentLocation,
                                                         radio.getApnInformation(),
                                                         radioEnabled, useProxy);

  storeRetrievedMms(masterSecret, contentLocation, messageId, threadId, retrieved);
  sendRetrievedAcknowledgement(transactionId, radioEnabled, useProxy);
}
 
开发者ID:Securecom,项目名称:Securecom-Text,代码行数:13,代码来源:MmsDownloader.java


示例13: retrieveMms

import ws.com.google.android.mms.pdu.RetrieveConf; //导入依赖的package包/类
public static RetrieveConf retrieveMms(Context context, String url, String apn,
                                       boolean usingMmsRadio, boolean proxyIfPossible)
    throws IOException, ApnUnavailableException
{
  MmsConnectionParameters connectionParameters = getMmsConnectionParameters(context, apn);
  byte[] pdu = null;

  for (MmsConnectionParameters.Apn param : connectionParameters.get()) {
    try {
      if (proxyIfPossible && param.hasProxy()) {
        if (checkRouteToHost(context, param.getProxy(), usingMmsRadio)) {
          pdu = makeRequest(url, param.getProxy(), param.getPort());
        }
      } else {
        if (checkRouteToHost(context, Uri.parse(url).getHost(), usingMmsRadio)) {
          pdu = makeRequest(url, null, -1);
        }
      }

      if (pdu != null) break;
    } catch (IOException ioe) {
      Log.w("MmsDownloadHelper", ioe);
    }
  }

  if (pdu == null) {
    throw new IOException("Connection manager could not obtain route to host.");
  }

  RetrieveConf retrieved = (RetrieveConf)new PduParser(pdu).parse();

  if (retrieved == null) {
    throw new IOException("Bad retrieved PDU");
  }

  return retrieved;
}
 
开发者ID:Securecom,项目名称:Securecom-Text,代码行数:38,代码来源:MmsDownloadHelper.java


示例14: retrieve

import ws.com.google.android.mms.pdu.RetrieveConf; //导入依赖的package包/类
@Override
@TargetApi(VERSION_CODES.LOLLIPOP)
public synchronized @Nullable RetrieveConf retrieve(@NonNull String contentLocation,
                                                    byte[] transactionId,
                                                    int subscriptionId) throws MmsException
{
  beginTransaction();

  try {
    MmsBodyProvider.Pointer pointer = MmsBodyProvider.makeTemporaryPointer(getContext());

    Log.w(TAG, "downloading multimedia from " + contentLocation + " to " + pointer.getUri());

    SmsManager smsManager;

    if (VERSION.SDK_INT >= 22 && subscriptionId != -1) {
      smsManager = SmsManager.getSmsManagerForSubscriptionId(subscriptionId);
    } else {
      smsManager = SmsManager.getDefault();
    }

    smsManager.downloadMultimediaMessage(getContext(),
                                         contentLocation,
                                         pointer.getUri(),
                                         null,
                                         getPendingIntent());

    waitForResult();

    ByteArrayOutputStream baos = new ByteArrayOutputStream();
    Util.copy(pointer.getInputStream(), baos);
    pointer.close();

    Log.w(TAG, baos.size() + "-byte response: " + Hex.dump(baos.toByteArray()));

    return (RetrieveConf) new PduParser(baos.toByteArray()).parse();
  } catch (IOException | TimeoutException e) {
    Log.w(TAG, e);
    throw new MmsException(e);
  } finally {
    endTransaction();
  }
}
 
开发者ID:XecureIT,项目名称:PeSanKita-android,代码行数:44,代码来源:IncomingLollipopMmsConnection.java


示例15: storeRetrievedMms

import ws.com.google.android.mms.pdu.RetrieveConf; //导入依赖的package包/类
private void storeRetrievedMms(MasterSecret masterSecret, String contentLocation,
                               long messageId, long threadId, RetrieveConf retrieved,
                               int subscriptionId)
    throws MmsException, NoSessionException, DuplicateMessageException, InvalidMessageException,
           LegacyMessageException
{
  MmsDatabase           database    = DatabaseFactory.getMmsDatabase(context);
  SingleUseBlobProvider provider    = SingleUseBlobProvider.getInstance();
  String                from        = null;
  List<String>          to          = new LinkedList<>();
  List<String>          cc          = new LinkedList<>();
  String                body        = null;
  List<Attachment>      attachments = new LinkedList<>();

  if (retrieved.getFrom() != null) {
    from = Util.toIsoString(retrieved.getFrom().getTextString());
  }

  if (retrieved.getTo() != null) {
    for (EncodedStringValue toValue : retrieved.getTo()) {
      to.add(Util.toIsoString(toValue.getTextString()));
    }
  }

  if (retrieved.getCc() != null) {
    for (EncodedStringValue ccValue : retrieved.getCc()) {
      cc.add(Util.toIsoString(ccValue.getTextString()));
    }
  }

  if (retrieved.getBody() != null) {
    body = PartParser.getMessageText(retrieved.getBody());
    PduBody media = PartParser.getSupportedMediaParts(retrieved.getBody());

    for (int i=0;i<media.getPartsNum();i++) {
      PduPart part = media.getPart(i);

      if (part.getData() != null) {
        Uri uri = provider.createUri(part.getData());
        attachments.add(new UriAttachment(uri, Util.toIsoString(part.getContentType()),
                                          AttachmentDatabase.TRANSFER_PROGRESS_DONE,
                                          part.getData().length));
      }
    }
  }



  IncomingMediaMessage   message      = new IncomingMediaMessage(from, to, cc, body, retrieved.getDate() * 1000L, attachments, subscriptionId, 0, false);
  Optional<InsertResult> insertResult = database.insertMessageInbox(new MasterSecretUnion(masterSecret),
                                                                    message, contentLocation, threadId);

  if (insertResult.isPresent()) {
    database.delete(messageId);
    MessageNotifier.updateNotification(context, masterSecret, insertResult.get().getThreadId());
  }
}
 
开发者ID:XecureIT,项目名称:PeSanKita-android,代码行数:58,代码来源:MmsDownloadJob.java


示例16: IncomingMediaMessage

import ws.com.google.android.mms.pdu.RetrieveConf; //导入依赖的package包/类
public IncomingMediaMessage(RetrieveConf retreived) {
  this.headers = retreived.getPduHeaders();
  this.body    = retreived.getBody();
  this.groupId = null;
  this.push    = false;
}
 
开发者ID:redcracker,项目名称:TextSecure,代码行数:7,代码来源:IncomingMediaMessage.java


示例17: IncomingMediaMessage

import ws.com.google.android.mms.pdu.RetrieveConf; //导入依赖的package包/类
public IncomingMediaMessage(RetrieveConf retrieved) {
  this.headers = retrieved.getPduHeaders();
  this.body    = retrieved.getBody();
  this.groupId = null;
  this.push    = false;
}
 
开发者ID:Agilitum,项目名称:TextSecureSMP,代码行数:7,代码来源:IncomingMediaMessage.java


示例18: retrieve

import ws.com.google.android.mms.pdu.RetrieveConf; //导入依赖的package包/类
@Override
@TargetApi(VERSION_CODES.LOLLIPOP)
public synchronized @Nullable RetrieveConf retrieve(@NonNull String contentLocation,
                                                    byte[] transactionId,
                                                    int subscriptionId) throws MmsException
{
  beginTransaction();

  try {
    MmsBodyProvider.Pointer pointer = MmsBodyProvider.makeTemporaryPointer(getContext());

    Log.w(TAG, "downloading multimedia from " + contentLocation + " to " + pointer.getUri());

    SmsManager smsManager;

    if (VERSION.SDK_INT >= 22 && subscriptionId != -1) {
      smsManager = SmsManager.getSmsManagerForSubscriptionId(subscriptionId);
    } else {
      smsManager = SmsManager.getDefault();
    }

    smsManager.downloadMultimediaMessage(getContext(),
                                         contentLocation,
                                         pointer.getUri(),
                                         null,
                                         getPendingIntent());

    waitForResult();

    ByteArrayOutputStream baos = new ByteArrayOutputStream();
    Util.copy(pointer.getInputStream(), baos);
    pointer.close();

    return (RetrieveConf) new PduParser(baos.toByteArray()).parse();
  } catch (IOException | TimeoutException e) {
    Log.w(TAG, e);
    throw new MmsException(e);
  } finally {
    endTransaction();
  }
}
 
开发者ID:SilenceIM,项目名称:Silence,代码行数:42,代码来源:IncomingLollipopMmsConnection.java


示例19: storeRetrievedMms

import ws.com.google.android.mms.pdu.RetrieveConf; //导入依赖的package包/类
private void storeRetrievedMms(MasterSecret masterSecret, String contentLocation,
                               long messageId, long threadId, RetrieveConf retrieved,
                               boolean isSecure, int subscriptionId)
    throws MmsException, NoSessionException, DuplicateMessageException, InvalidMessageException,
           LegacyMessageException
{
  MmsDatabase           database    = DatabaseFactory.getMmsDatabase(context);
  SingleUseBlobProvider provider    = SingleUseBlobProvider.getInstance();
  String                from        = null;
  List<String>          to          = new LinkedList<>();
  List<String>          cc          = new LinkedList<>();
  String                body        = null;
  List<Attachment>      attachments = new LinkedList<>();

  if (retrieved.getFrom() != null) {
    from = Util.toIsoString(retrieved.getFrom().getTextString());
  }

  if (retrieved.getTo() != null) {
    for (EncodedStringValue toValue : retrieved.getTo()) {
      to.add(Util.toIsoString(toValue.getTextString()));
    }
  }

  if (retrieved.getCc() != null) {
    for (EncodedStringValue ccValue : retrieved.getCc()) {
      cc.add(Util.toIsoString(ccValue.getTextString()));
    }
  }

  if (retrieved.getBody() != null) {
    body = PartParser.getMessageText(retrieved.getBody());
    PduBody media = PartParser.getSupportedMediaParts(retrieved.getBody());

    for (int i=0;i<media.getPartsNum();i++) {
      PduPart part = media.getPart(i);

      if (part.getData() != null) {
        Uri uri = provider.createUri(part.getData());
        attachments.add(new UriAttachment(uri, Util.toIsoString(part.getContentType()),
                                          AttachmentDatabase.TRANSFER_PROGRESS_DONE,
                                          part.getData().length));
      }
    }
  }

  IncomingMediaMessage message = new IncomingMediaMessage(from, to, cc, body, retrieved.getDate() * 1000L, attachments, subscriptionId);

  Pair<Long, Long> messageAndThreadId;

  if (isSecure) {
    messageAndThreadId = database.insertSecureDecryptedMessageInbox(masterSecret, message,
                                                                    threadId);
  } else {
    messageAndThreadId = database.insertMessageInbox(masterSecret, message,
                                                     contentLocation, threadId);
  }

  database.delete(messageId);
  MessageNotifier.updateNotification(context, masterSecret, messageAndThreadId.second);
}
 
开发者ID:SilenceIM,项目名称:Silence,代码行数:62,代码来源:MmsDownloadJob.java


示例20: retrieve

import ws.com.google.android.mms.pdu.RetrieveConf; //导入依赖的package包/类
@Nullable RetrieveConf retrieve(@NonNull String contentLocation, byte[] transactionId, int subscriptionId) throws MmsException, MmsRadioException, ApnUnavailableException, IOException; 
开发者ID:XecureIT,项目名称:PeSanKita-android,代码行数:2,代码来源:IncomingMmsConnection.java



注:本文中的ws.com.google.android.mms.pdu.RetrieveConf类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java R类代码示例发布时间:2022-05-22
下一篇:
Java Stopwatch类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap