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


Java MessageNotifier.notifyMessageDeliveryFailed方法代码示例

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


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

示例1: handleSentResult

import org.thoughtcrime.securesms.notifications.MessageNotifier; //导入方法依赖的package包/类
private void handleSentResult(MasterSecret masterSecret, long messageId, int result) {
  try {
    EncryptingSmsDatabase database = DatabaseFactory.getEncryptingSmsDatabase(context);
    SmsMessageRecord      record   = database.getMessage(masterSecret, messageId);

    switch (result) {
      case Activity.RESULT_OK:
        database.markAsSent(messageId, false);
        break;
      case SmsManager.RESULT_ERROR_NO_SERVICE:
      case SmsManager.RESULT_ERROR_RADIO_OFF:
        Log.w(TAG, "Service connectivity problem, requeuing...");
        ApplicationContext.getInstance(context)
            .getJobManager()
            .add(new SmsSendJob(context, messageId, record.getIndividualRecipient().getNumber()));
        break;
      default:
        database.markAsSentFailed(messageId);
        MessageNotifier.notifyMessageDeliveryFailed(context, record.getRecipients(), record.getThreadId());
    }
  } catch (NoSuchMessageException e) {
    Log.w(TAG, e);
  }
}
 
开发者ID:XecureIT,项目名称:PeSanKita-android,代码行数:25,代码来源:SmsSentJob.java

示例2: onRun

import org.thoughtcrime.securesms.notifications.MessageNotifier; //导入方法依赖的package包/类
@Override
public void onRun(MasterSecret masterSecret) throws NoSuchMessageException {
  EncryptingSmsDatabase database = DatabaseFactory.getEncryptingSmsDatabase(context);
  SmsMessageRecord      record   = database.getMessage(masterSecret, messageId);

  try {
    Log.w(TAG, "Sending message: " + messageId);

    deliver(masterSecret, record);
  } catch (UndeliverableMessageException ude) {
    Log.w(TAG, ude);
    DatabaseFactory.getSmsDatabase(context).markAsSentFailed(record.getId());
    MessageNotifier.notifyMessageDeliveryFailed(context, record.getRecipients(), record.getThreadId());
  } catch (InsecureFallbackApprovalException ifae) {
    Log.w(TAG, ifae);
    DatabaseFactory.getSmsDatabase(context).markAsPendingInsecureSmsFallback(record.getId());
    MessageNotifier.notifyMessageDeliveryFailed(context, record.getRecipients(), record.getThreadId());
  }
}
 
开发者ID:redcracker,项目名称:TextSecure,代码行数:20,代码来源:SmsSendJob.java

示例3: notifyMediaMessageDeliveryFailed

import org.thoughtcrime.securesms.notifications.MessageNotifier; //导入方法依赖的package包/类
protected void notifyMediaMessageDeliveryFailed(Context context, long messageId) {
  long       threadId   = DatabaseFactory.getMmsDatabase(context).getThreadIdForMessage(messageId);
  Recipients recipients = DatabaseFactory.getThreadDatabase(context).getRecipientsForThreadId(threadId);

  if (threadId != -1 && recipients != null) {
    MessageNotifier.notifyMessageDeliveryFailed(context, recipients, threadId);
  }
}
 
开发者ID:XecureIT,项目名称:PeSanKita-android,代码行数:9,代码来源:PushSendJob.java

示例4: onCanceled

import org.thoughtcrime.securesms.notifications.MessageNotifier; //导入方法依赖的package包/类
@Override
public void onCanceled() {
  DatabaseFactory.getSmsDatabase(context).markAsSentFailed(messageId);

  long       threadId   = DatabaseFactory.getSmsDatabase(context).getThreadIdForMessage(messageId);
  Recipients recipients = DatabaseFactory.getThreadDatabase(context).getRecipientsForThreadId(threadId);

  if (threadId != -1 && recipients != null) {
    MessageNotifier.notifyMessageDeliveryFailed(context, recipients, threadId);
  }
}
 
开发者ID:XecureIT,项目名称:PeSanKita-android,代码行数:12,代码来源:PushTextSendJob.java

示例5: onSend

import org.thoughtcrime.securesms.notifications.MessageNotifier; //导入方法依赖的package包/类
@Override
public void onSend(MasterSecret masterSecret) throws NoSuchMessageException {
  EncryptingSmsDatabase database = DatabaseFactory.getEncryptingSmsDatabase(context);
  SmsMessageRecord      record   = database.getMessage(masterSecret, messageId);

  try {
    Log.w(TAG, "Sending message: " + messageId);

    deliver(record);
  } catch (UndeliverableMessageException ude) {
    Log.w(TAG, ude);
    DatabaseFactory.getSmsDatabase(context).markAsSentFailed(record.getId());
    MessageNotifier.notifyMessageDeliveryFailed(context, record.getRecipients(), record.getThreadId());
  }
}
 
开发者ID:XecureIT,项目名称:PeSanKita-android,代码行数:16,代码来源:SmsSendJob.java

示例6: onCanceled

import org.thoughtcrime.securesms.notifications.MessageNotifier; //导入方法依赖的package包/类
@Override
public void onCanceled() {
  Log.w(TAG, "onCanceled()");
  long       threadId   = DatabaseFactory.getSmsDatabase(context).getThreadIdForMessage(messageId);
  Recipients recipients = DatabaseFactory.getThreadDatabase(context).getRecipientsForThreadId(threadId);

  DatabaseFactory.getSmsDatabase(context).markAsSentFailed(messageId);
  MessageNotifier.notifyMessageDeliveryFailed(context, recipients, threadId);
}
 
开发者ID:XecureIT,项目名称:PeSanKita-android,代码行数:10,代码来源:SmsSendJob.java

示例7: notifyMediaMessageDeliveryFailed

import org.thoughtcrime.securesms.notifications.MessageNotifier; //导入方法依赖的package包/类
private void notifyMediaMessageDeliveryFailed(Context context, long messageId) {
  long       threadId   = DatabaseFactory.getMmsDatabase(context).getThreadIdForMessage(messageId);
  Recipients recipients = DatabaseFactory.getThreadDatabase(context).getRecipientsForThreadId(threadId);

  if (recipients != null) {
    MessageNotifier.notifyMessageDeliveryFailed(context, recipients, threadId);
  }
}
 
开发者ID:XecureIT,项目名称:PeSanKita-android,代码行数:9,代码来源:MmsSendJob.java

示例8: handleSentResult

import org.thoughtcrime.securesms.notifications.MessageNotifier; //导入方法依赖的package包/类
private void handleSentResult(MasterSecret masterSecret, long messageId, int result) {
  try {
    EncryptingSmsDatabase database = DatabaseFactory.getEncryptingSmsDatabase(context);
    SmsMessageRecord      record   = database.getMessage(masterSecret, messageId);

    switch (result) {
      case Activity.RESULT_OK:
        database.markAsSent(messageId);

        if (record != null && record.isEndSession()) {
          Log.w(TAG, "Ending session...");
          SessionStore sessionStore = new TextSecureSessionStore(context, masterSecret);
          sessionStore.deleteAllSessions(record.getIndividualRecipient().getRecipientId());
          SecurityEvent.broadcastSecurityUpdateEvent(context, record.getThreadId());
        }

        break;
      case SmsManager.RESULT_ERROR_NO_SERVICE:
      case SmsManager.RESULT_ERROR_RADIO_OFF:
        Log.w(TAG, "Service connectivity problem, requeuing...");
        ApplicationContext.getInstance(context)
            .getJobManager()
            .add(new SmsSendJob(context, messageId, record.getIndividualRecipient().getNumber()));

        break;
      default:
        database.markAsSentFailed(messageId);
        MessageNotifier.notifyMessageDeliveryFailed(context, record.getRecipients(), record.getThreadId());
    }
  } catch (NoSuchMessageException e) {
    Log.w(TAG, e);
  }
}
 
开发者ID:redcracker,项目名称:TextSecure,代码行数:34,代码来源:SmsSentJob.java

示例9: onCanceled

import org.thoughtcrime.securesms.notifications.MessageNotifier; //导入方法依赖的package包/类
@Override
public void onCanceled() {
  DatabaseFactory.getSmsDatabase(context).markAsSentFailed(messageId);

  long       threadId   = DatabaseFactory.getSmsDatabase(context).getThreadIdForMessage(messageId);
  Recipients recipients = DatabaseFactory.getThreadDatabase(context).getRecipientsForThreadId(threadId);

  MessageNotifier.notifyMessageDeliveryFailed(context, recipients, threadId);
}
 
开发者ID:redcracker,项目名称:TextSecure,代码行数:10,代码来源:PushTextSendJob.java

示例10: notifyMediaMessageDeliveryFailed

import org.thoughtcrime.securesms.notifications.MessageNotifier; //导入方法依赖的package包/类
protected void notifyMediaMessageDeliveryFailed(Context context, long messageId) {
  long       threadId   = DatabaseFactory.getMmsDatabase(context).getThreadIdForMessage(messageId);
  Recipients recipients = DatabaseFactory.getThreadDatabase(context).getRecipientsForThreadId(threadId);

  MessageNotifier.notifyMessageDeliveryFailed(context, recipients, threadId);
}
 
开发者ID:redcracker,项目名称:TextSecure,代码行数:7,代码来源:PushSendJob.java

示例11: notifyMediaMessageDeliveryFailed

import org.thoughtcrime.securesms.notifications.MessageNotifier; //导入方法依赖的package包/类
private void notifyMediaMessageDeliveryFailed(Context context, long messageId) {
  long       threadId   = DatabaseFactory.getMmsDatabase(context).getThreadIdForMessage(messageId);
  Recipients recipients = DatabaseFactory.getThreadDatabase(context).getRecipientsForThreadId(threadId);

  MessageNotifier.notifyMessageDeliveryFailed(context, recipients, threadId);
}
 
开发者ID:redcracker,项目名称:TextSecure,代码行数:7,代码来源:MmsSendJob.java


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