当前位置: 首页>>代码示例>>Java>>正文


Java MmsSendResult类代码示例

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


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

示例1: getSendResult

import org.thoughtcrime.securesms.mms.MmsSendResult; //导入依赖的package包/类
private MmsSendResult getSendResult(SendConf conf, SendReq message)
    throws UndeliverableMessageException
{
  if (conf == null) {
    throw new UndeliverableMessageException("No M-Send.conf received in response to send.");
  } else if (conf.getResponseStatus() != PduHeaders.RESPONSE_STATUS_OK) {
    throw new UndeliverableMessageException("Got bad response: " + conf.getResponseStatus());
  } else if (isInconsistentResponse(message, conf)) {
    throw new UndeliverableMessageException("Mismatched response!");
  } else {
    return new MmsSendResult(conf.getMessageId(), conf.getResponseStatus());
  }
}
 
开发者ID:XecureIT,项目名称:PeSanKita-android,代码行数:14,代码来源:MmsSendJob.java

示例2: sendMms

import org.thoughtcrime.securesms.mms.MmsSendResult; //导入依赖的package包/类
private MmsSendResult sendMms(MasterSecret masterSecret, MmsRadio radio, SendReq message,
                              boolean usingMmsRadio, boolean useProxy)
    throws IOException, UndeliverableMessageException, InsecureFallbackApprovalException
{
  String  number         = ((TelephonyManager)context.getSystemService(Context.TELEPHONY_SERVICE)).getLine1Number();
  boolean upgradedSecure = false;

  if (MmsDatabase.Types.isSecureType(message.getDatabaseMessageBox())) {
    message        = getEncryptedMessage(masterSecret, message);
    upgradedSecure = true;
  }

  if (number != null && number.trim().length() != 0) {
    message.setFrom(new EncodedStringValue(number));
  }

  try {
    OutgoingMmsConnection connection = new OutgoingMmsConnection(context, radio.getApnInformation(), new PduComposer(context, message).make());
    SendConf conf = connection.send(usingMmsRadio, useProxy);

    for (int i=0;i<message.getBody().getPartsNum();i++) {
      Log.w(TAG, "Sent MMS part of content-type: " + new String(message.getBody().getPart(i).getContentType()));
    }

    if (conf == null) {
      throw new UndeliverableMessageException("No M-Send.conf received in response to send.");
    } else if (conf.getResponseStatus() != PduHeaders.RESPONSE_STATUS_OK) {
      throw new UndeliverableMessageException("Got bad response: " + conf.getResponseStatus());
    } else if (isInconsistentResponse(message, conf)) {
      throw new UndeliverableMessageException("Mismatched response!");
    } else {
      return new MmsSendResult(conf.getMessageId(), conf.getResponseStatus(), upgradedSecure, false);
    }
  } catch (ApnUnavailableException aue) {
    throw new IOException("no APN was retrievable");
  }
}
 
开发者ID:redcracker,项目名称:TextSecure,代码行数:38,代码来源:MmsSendJob.java


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