本文整理汇总了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()));
}
}
示例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()));
}
}
示例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());
}
}
示例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));
}
示例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");
}
示例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()));
}
示例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()));
}
示例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));
}
示例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()));
}
示例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));
}
示例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));
}
示例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()));
}
示例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));
}
示例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()));
}