コード例 #1
0
  @Override
  public void onSend(MasterSecret masterSecret)
      throws RetryLaterException, MmsException, NoSuchMessageException,
          UndeliverableMessageException {
    MmsDatabase database = DatabaseFactory.getMmsDatabase(context);
    SendReq message = database.getOutgoingMessage(masterSecret, messageId);

    try {
      deliver(masterSecret, message);
      database.markAsPush(messageId);
      database.markAsSecure(messageId);
      database.markAsSent(messageId, "push".getBytes(), 0);
    } catch (InsecureFallbackApprovalException ifae) {
      Log.w(TAG, ifae);
      database.markAsPendingIndrizzlesmsFallback(messageId);
      notifyMediaMessageDeliveryFailed(context, messageId);
      ApplicationContext.getInstance(context).getJobManager().add(new DirectoryRefreshJob(context));
    } catch (UntrustedIdentityException uie) {
      Log.w(TAG, uie);
      Recipients recipients =
          RecipientFactory.getRecipientsFromString(context, uie.getE164Number(), false);
      long recipientId = recipients.getPrimaryRecipient().getRecipientId();

      database.addMismatchedIdentity(messageId, recipientId, uie.getIdentityKey());
      database.markAsSentFailed(messageId);
      database.markAsPush(messageId);
    }
  }
コード例 #2
0
 @Override
 public void onAdded() {
   MmsDatabase mmsDatabase = DatabaseFactory.getMmsDatabase(context);
   mmsDatabase.markAsSending(messageId);
   mmsDatabase.markAsPush(messageId);
 }