protected void savePendingMessage(Message message) { // only save to pending when the number is not blacklisted if (!mPrefsFactory.enableBlacklist().get()) { message.status = Message.Status.FAILED; mMessageDatabaseHelper.put(message); } }
protected void deleteFromSmsInbox(Message message) { if (mPrefsFactory.autoDelete().get()) { mProcessSms.delSmsFromInbox(map(message)); mFileManager.appendAndClose( mContext.getString(R.string.auto_message_deleted, message.messageBody)); } }
public void processRetries(Message message) { if (message.retries > mPrefsFactory.retries().get()) { // Delete from db deleteMessage(message); } else { // Increase message's number of tries for future comparison to know when to delete it. int retries = message.retries + 1; message.retries = retries; mMessageDatabaseHelper.put(message); } }
protected boolean sendTaskSms(Message message) { if (message.messageDate == null || !TextUtils.isEmpty(message.messageUuid)) { final Long timeMills = System.currentTimeMillis(); message.messageDate = new Date(timeMills); } if (message.messageUuid == null || TextUtils.isEmpty(message.messageUuid)) { message.messageUuid = mProcessSms.getUuid(); } message.messageType = Message.Type.TASK; if (mPrefsFactory.smsReportDelivery().get()) { mProcessSms.sendSms(map(message), true); } mProcessSms.sendSms(map(message), false); return true; }