On Android if you minimize the app and wait, then reopen it, sometimes it takes up to a minute for the connection to be restored.
Channel.Builder
.usePlaintext()
.withKeepAliveConfig(
KeepAliveConfig.Enabled(
time = 15.seconds,
timeout = 5.seconds,
withoutCalls = true
)
).build()
It seems that ManagedChannel has a resetConnectBackoff method to deal with this; maybe it should be made available in Channel