private void checkConnectionNotNull(ImapConnection conn) throws MessagingException { if (conn == null) { String message = "Could not establish connection for IDLE"; pushReceiver.pushError(message, null); throw new MessagingException(message); } }
private void syncMessages(List<Long> flagSyncMsgSeqs) { try { Set<Long> messageSeqSet = new HashSet<>(flagSyncMsgSeqs); List<? extends Message> messageList = getMessages(messageSeqSet, true, null); List<Message> messages = new ArrayList<>(messageList); pushReceiver.messagesFlagsChanged(ImapFolderPusher.this, messages); } catch (Exception e) { pushReceiver.pushError("Exception while processing Push untagged responses", e); } }
private void checkConnectionIdleCapable(ImapConnection conn) throws MessagingException { if (!conn.isIdleCapable()) { stop = true; String message = "IMAP server is not IDLE capable: " + conn.toString(); pushReceiver.pushError(message, null); throw new MessagingException(message); } }
pushReceiver.pushError("Push error for " + getServerId(), e); } catch (Exception e) { reacquireWakeLockAndCleanUp(); Timber.i("Got exception while idling, but stop is set for %s", getLogId()); } else { pushReceiver.pushError("Push error for " + getServerId(), e); Timber.e("Got exception while idling for %s", getLogId()); if (idleFailureCount > IDLE_FAILURE_COUNT_LIMIT) { Timber.e("Disabling pusher for %s after %d consecutive errors", getLogId(), idleFailureCount); pushReceiver.pushError("Push disabled for " + getServerId() + " after " + idleFailureCount + " consecutive errors", e); stop = true;