Loading mail/protocols/imap/src/main/java/com/fsck/k9/mail/store/imap/ImapConnection.kt +0 −3 Original line number Diff line number Diff line Loading @@ -44,7 +44,4 @@ internal interface ImapConnection { @Throws(SocketException::class) fun setSocketReadTimeout(timeout: Int) @Throws(IOException::class) fun isDataAvailable(): Boolean } mail/protocols/imap/src/main/java/com/fsck/k9/mail/store/imap/RealImapConnection.java +0 −5 Original line number Diff line number Diff line Loading @@ -910,11 +910,6 @@ class RealImapConnection implements ImapConnection { return isCondstoreCapable() ? LENGTH_LIMIT_WITH_CONDSTORE : LENGTH_LIMIT_WITHOUT_CONDSTORE; } @Override public boolean isDataAvailable() throws IOException { return inputStream.available() > 0; } @Override public int getConnectionGeneration() { return connectionGeneration; Loading mail/protocols/imap/src/main/java/com/fsck/k9/mail/store/imap/RealImapFolderIdler.kt +7 −14 Original line number Diff line number Diff line Loading @@ -95,26 +95,19 @@ internal class RealImapFolderIdler( var response: ImapResponse do { val expectSleeping = !connection.isDataAvailable() && !stopIdle idleRefreshTimer = idleRefreshManager.startTimer( timeout = idleRefreshTimeoutProvider.idleRefreshTimeoutMs, callback = ::idleRefresh ) idleRefreshTimer = if (expectSleeping) { idleRefreshManager.startTimer(idleRefreshTimeoutProvider.idleRefreshTimeoutMs) { idleRefresh() } } else { null } if (expectSleeping) { wakeLock.release() } try { response = connection.readResponse() } finally { if (expectSleeping) { wakeLock.acquire() idleRefreshTimer?.cancel() } } if (response.isRelevant && !stopIdle) { Timber.v("%s.idle(): Received a relevant untagged response during IDLE", logTag) Loading mail/protocols/imap/src/test/java/com/fsck/k9/mail/store/imap/RealImapFolderIdlerTest.kt +0 −1 Original line number Diff line number Diff line Loading @@ -121,7 +121,6 @@ class RealImapFolderIdlerTest { wakeLock.waitForRelease() imapConnection.enqueueUntaggedServerResponse("1 EXISTS") imapConnection.waitForCommand("DONE") assertThat(wakeLock.isHeld).isTrue() imapConnection.enqueueTaggedServerResponse("OK") latch.awaitWithTimeout() Loading mail/protocols/imap/src/test/java/com/fsck/k9/mail/store/imap/TestImapConnection.kt +0 −2 Original line number Diff line number Diff line Loading @@ -94,8 +94,6 @@ internal open class TestImapConnection(val timeout: Long, override val connectio currentSocketReadTimeout = timeout } override fun isDataAvailable(): Boolean = false fun waitForCommand(command: String) { do { val receivedCommand = receivedCommands.poll(timeout, TimeUnit.SECONDS) ?: throw AssertionError("Timeout") Loading Loading
mail/protocols/imap/src/main/java/com/fsck/k9/mail/store/imap/ImapConnection.kt +0 −3 Original line number Diff line number Diff line Loading @@ -44,7 +44,4 @@ internal interface ImapConnection { @Throws(SocketException::class) fun setSocketReadTimeout(timeout: Int) @Throws(IOException::class) fun isDataAvailable(): Boolean }
mail/protocols/imap/src/main/java/com/fsck/k9/mail/store/imap/RealImapConnection.java +0 −5 Original line number Diff line number Diff line Loading @@ -910,11 +910,6 @@ class RealImapConnection implements ImapConnection { return isCondstoreCapable() ? LENGTH_LIMIT_WITH_CONDSTORE : LENGTH_LIMIT_WITHOUT_CONDSTORE; } @Override public boolean isDataAvailable() throws IOException { return inputStream.available() > 0; } @Override public int getConnectionGeneration() { return connectionGeneration; Loading
mail/protocols/imap/src/main/java/com/fsck/k9/mail/store/imap/RealImapFolderIdler.kt +7 −14 Original line number Diff line number Diff line Loading @@ -95,26 +95,19 @@ internal class RealImapFolderIdler( var response: ImapResponse do { val expectSleeping = !connection.isDataAvailable() && !stopIdle idleRefreshTimer = idleRefreshManager.startTimer( timeout = idleRefreshTimeoutProvider.idleRefreshTimeoutMs, callback = ::idleRefresh ) idleRefreshTimer = if (expectSleeping) { idleRefreshManager.startTimer(idleRefreshTimeoutProvider.idleRefreshTimeoutMs) { idleRefresh() } } else { null } if (expectSleeping) { wakeLock.release() } try { response = connection.readResponse() } finally { if (expectSleeping) { wakeLock.acquire() idleRefreshTimer?.cancel() } } if (response.isRelevant && !stopIdle) { Timber.v("%s.idle(): Received a relevant untagged response during IDLE", logTag) Loading
mail/protocols/imap/src/test/java/com/fsck/k9/mail/store/imap/RealImapFolderIdlerTest.kt +0 −1 Original line number Diff line number Diff line Loading @@ -121,7 +121,6 @@ class RealImapFolderIdlerTest { wakeLock.waitForRelease() imapConnection.enqueueUntaggedServerResponse("1 EXISTS") imapConnection.waitForCommand("DONE") assertThat(wakeLock.isHeld).isTrue() imapConnection.enqueueTaggedServerResponse("OK") latch.awaitWithTimeout() Loading
mail/protocols/imap/src/test/java/com/fsck/k9/mail/store/imap/TestImapConnection.kt +0 −2 Original line number Diff line number Diff line Loading @@ -94,8 +94,6 @@ internal open class TestImapConnection(val timeout: Long, override val connectio currentSocketReadTimeout = timeout } override fun isDataAvailable(): Boolean = false fun waitForCommand(command: String) { do { val receivedCommand = receivedCommands.poll(timeout, TimeUnit.SECONDS) ?: throw AssertionError("Timeout") Loading