當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。