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


Java JobManager.add方法代码示例

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


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

示例1: handleMessage

import org.whispersystems.jobqueue.JobManager; //导入方法依赖的package包/类
private void handleMessage(SignalServiceEnvelope envelope, boolean sendExplicitReceipt) {
  Recipients recipients = RecipientFactory.getRecipientsFromString(context, envelope.getSource(), false);
  JobManager jobManager = ApplicationContext.getInstance(context).getJobManager();

  if (!recipients.isBlocked()) {
    long messageId = DatabaseFactory.getPushDatabase(context).insert(envelope);
    jobManager.add(new PushDecryptJob(context, messageId, envelope.getSource()));
  } else {
    Log.w(TAG, "*** Received blocked push message, ignoring...");
  }

  if (sendExplicitReceipt) {
    jobManager.add(new DeliveryReceiptJob(context, envelope.getSource(),
                                          envelope.getTimestamp(),
                                          envelope.getRelay()));
  }
}
 
开发者ID:XecureIT,项目名称:PeSanKita-android,代码行数:18,代码来源:PushReceivedJob.java

示例2: handleMessage

import org.whispersystems.jobqueue.JobManager; //导入方法依赖的package包/类
private void handleMessage(TextSecureEnvelope envelope, boolean sendExplicitReceipt) {
  Recipients recipients = RecipientFactory.getRecipientsFromString(context, envelope.getSource(), false);
  JobManager jobManager = ApplicationContext.getInstance(context).getJobManager();

  if (!recipients.isBlocked()) {
    long messageId = DatabaseFactory.getPushDatabase(context).insert(envelope);
    jobManager.add(new PushDecryptJob(context, messageId, envelope.getSource()));
  } else {
    Log.w(TAG, "*** Received blocked push message, ignoring...");
  }

  if (sendExplicitReceipt) {
    jobManager.add(new DeliveryReceiptJob(context, envelope.getSource(),
                                          envelope.getTimestamp(),
                                          envelope.getRelay()));
  }
}
 
开发者ID:Agilitum,项目名称:TextSecureSMP,代码行数:18,代码来源:PushReceivedJob.java

示例3: onReceive

import org.whispersystems.jobqueue.JobManager; //导入方法依赖的package包/类
@Override
public void onReceive(Context context, Intent intent) {
  JobManager jobManager = ApplicationContext.getInstance(context).getJobManager();
  long       messageId  = intent.getLongExtra("message_id", -1);

  switch (intent.getAction()) {
    case SENT_SMS_ACTION:
      int result = getResultCode();

      jobManager.add(new SmsSentJob(context, messageId, SENT_SMS_ACTION, result));
      break;
    case DELIVERED_SMS_ACTION:
      byte[] pdu = intent.getByteArrayExtra("pdu");

      if (pdu == null) {
        Log.w(TAG, "No PDU in delivery receipt!");
        break;
      }

      SmsMessage message = SmsMessage.createFromPdu(pdu);

      if (message == null) {
        Log.w(TAG, "Delivery receipt failed to parse!");
        break;
      }

      jobManager.add(new SmsSentJob(context, messageId, DELIVERED_SMS_ACTION, message.getStatus()));
      break;
    default:
      Log.w(TAG, "Unknown action: " + intent.getAction());
  }
}
 
开发者ID:XecureIT,项目名称:PeSanKita-android,代码行数:33,代码来源:SmsDeliveryListener.java

示例4: handleMessage

import org.whispersystems.jobqueue.JobManager; //导入方法依赖的package包/类
private void handleMessage(TextSecureEnvelope envelope) {
  JobManager jobManager = ApplicationContext.getInstance(context).getJobManager();
  long       messageId  = DatabaseFactory.getPushDatabase(context).insert(envelope);

  jobManager.add(new DeliveryReceiptJob(context, envelope.getSource(),
                                        envelope.getTimestamp(),
                                        envelope.getRelay()));

  jobManager.add(new PushDecryptJob(context, messageId));
}
 
开发者ID:redcracker,项目名称:TextSecure,代码行数:11,代码来源:PushReceiveJob.java

示例5: sendSMPPush

import org.whispersystems.jobqueue.JobManager; //导入方法依赖的package包/类
private static void sendSMPPush(Context context, Recipients recipients, long messageId)
{
  JobManager jobManager = ApplicationContext.getInstance(context).getJobManager();
  jobManager.add(new PushSMPSendJob(context, messageId, recipients.getPrimaryRecipient()
    .getNumber()));
  Log.d(TAG, "PushSMPSendJob added");
}
 
开发者ID:Agilitum,项目名称:TextSecureSMP,代码行数:8,代码来源:MessageSender.java

示例6: sendTextPush

import org.whispersystems.jobqueue.JobManager; //导入方法依赖的package包/类
private static void sendTextPush(Context context, Recipients recipients, long messageId) {
  JobManager jobManager = ApplicationContext.getInstance(context).getJobManager();
  jobManager.add(new PushTextSendJob(context, messageId, recipients.getPrimaryRecipient().getNumber()));
}
 
开发者ID:XecureIT,项目名称:PeSanKita-android,代码行数:5,代码来源:MessageSender.java

示例7: sendMediaPush

import org.whispersystems.jobqueue.JobManager; //导入方法依赖的package包/类
private static void sendMediaPush(Context context, Recipients recipients, long messageId) {
  JobManager jobManager = ApplicationContext.getInstance(context).getJobManager();
  jobManager.add(new PushMediaSendJob(context, messageId, recipients.getPrimaryRecipient().getNumber()));
}
 
开发者ID:XecureIT,项目名称:PeSanKita-android,代码行数:5,代码来源:MessageSender.java

示例8: sendGroupPush

import org.whispersystems.jobqueue.JobManager; //导入方法依赖的package包/类
private static void sendGroupPush(Context context, Recipients recipients, long messageId, long filterRecipientId, Recipients destRecipients) {
  JobManager jobManager = ApplicationContext.getInstance(context).getJobManager();
  jobManager.add(new PushGroupSendJob(context, messageId, recipients.getPrimaryRecipient().getNumber(), filterRecipientId, destRecipients));
}
 
开发者ID:XecureIT,项目名称:PeSanKita-android,代码行数:5,代码来源:MessageSender.java

示例9: sendSms

import org.whispersystems.jobqueue.JobManager; //导入方法依赖的package包/类
private static void sendSms(Context context, Recipients recipients, long messageId) {
  JobManager jobManager = ApplicationContext.getInstance(context).getJobManager();
  jobManager.add(new SmsSendJob(context, messageId, recipients.getPrimaryRecipient().getName()));
}
 
开发者ID:XecureIT,项目名称:PeSanKita-android,代码行数:5,代码来源:MessageSender.java

示例10: sendMms

import org.whispersystems.jobqueue.JobManager; //导入方法依赖的package包/类
private static void sendMms(Context context, long messageId) {
  JobManager jobManager = ApplicationContext.getInstance(context).getJobManager();
  jobManager.add(new MmsSendJob(context, messageId));
}
 
开发者ID:XecureIT,项目名称:PeSanKita-android,代码行数:5,代码来源:MessageSender.java

示例11: sendGroupPush

import org.whispersystems.jobqueue.JobManager; //导入方法依赖的package包/类
private static void sendGroupPush(Context context, Recipients recipients, long messageId, long filterRecipientId) {
  JobManager jobManager = ApplicationContext.getInstance(context).getJobManager();
  jobManager.add(new PushGroupSendJob(context, messageId, recipients.getPrimaryRecipient().getNumber(), filterRecipientId));
}
 
开发者ID:CableIM,项目名称:Cable-Android,代码行数:5,代码来源:MessageSender.java

示例12: sendGroupPush

import org.whispersystems.jobqueue.JobManager; //导入方法依赖的package包/类
private static void sendGroupPush(Context context, Recipients recipients, long messageId) {
  JobManager jobManager = ApplicationContext.getInstance(context).getJobManager();
  jobManager.add(new PushGroupSendJob(context, messageId, recipients.getPrimaryRecipient().getNumber()));
}
 
开发者ID:redcracker,项目名称:TextSecure,代码行数:5,代码来源:MessageSender.java

示例13: sendMediaMessage

import org.whispersystems.jobqueue.JobManager; //导入方法依赖的package包/类
private static void sendMediaMessage(Context context, long messageId)
    throws MmsException
{
  JobManager jobManager = ApplicationContext.getInstance(context).getJobManager();
  jobManager.add(new MmsSendJob(context, messageId));
}
 
开发者ID:SilenceIM,项目名称:Silence,代码行数:7,代码来源:MessageSender.java

示例14: sendTextMessage

import org.whispersystems.jobqueue.JobManager; //导入方法依赖的package包/类
private static void sendTextMessage(Context context, Recipients recipients, long messageId)
{
  JobManager jobManager = ApplicationContext.getInstance(context).getJobManager();
  jobManager.add(new SmsSendJob(context, messageId, recipients.getPrimaryRecipient().getName()));
}
 
开发者ID:SilenceIM,项目名称:Silence,代码行数:6,代码来源:MessageSender.java


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