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


Java SendConf.getMessageId方法代码示例

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


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

示例1: getSendResult

import ws.com.google.android.mms.pdu.SendConf; //导入方法依赖的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 ws.com.google.android.mms.pdu.SendConf; //导入方法依赖的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

示例3: getSendResult

import ws.com.google.android.mms.pdu.SendConf; //导入方法依赖的package包/类
private MmsSendResult getSendResult(SendConf conf, SendReq message, boolean upgradedSecure)
    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(), upgradedSecure, false);
  }
}
 
开发者ID:SilenceIM,项目名称:Silence,代码行数:14,代码来源:MmsSendJob.java

示例4: sendMms

import ws.com.google.android.mms.pdu.SendConf; //导入方法依赖的package包/类
private MmsSendResult sendMms(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(message);
    upgradedSecure = true;
  }

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

  SendConf conf = MmsSendHelper.sendMms(context, new PduComposer(context, message).make(),
                                        radio.getApnInformation(), usingMmsRadio, useProxy);

  for (int i=0;i<message.getBody().getPartsNum();i++) {
    Log.w("MmsSender", "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);
  }
}
 
开发者ID:Securecom,项目名称:Securecom-Text,代码行数:33,代码来源:MmsTransport.java


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