Before, the call to closeAll() in McsService#connect() would trigger a SocketException (Socket closed) in McsOutputStream and/or McsInputStream. This would send a teardown message causing McsService to take the new connection down right away. In unlucky situations, this could cause small connect/teardown loops. This commit hopes to prevent those.
Change-Id: Id347d598e028bdd1ba2622cd6a5c6b07874335d6
Waiting twice the heartbeat interval since the last ACK can make us miss dead connections for more than 10min in which no push messages get received.
This change requires the ACK to come within 90 seconds of sending the heartbeat ping, otherwise the connection is considered dead which will trigger a re-connect.
We use a high timeout of 90 seconds, because in some mobile networks (like in trains) ping times of more than 60 seconds have been observed in practice.
Change-Id: I8e63843400b47e1a6d23faf180f9446bcb5e0cd8
This may cause a connection attempt, but in connect(), we'll notice that it is disabled and won't continue to connect.
Change-Id: Id5f00539a48fad16b5e5f55bd336fb8890aa1acc
Otherwise, this gets called multiple times from different places via MSG_TEARDOWN. This causes the reconnect delay to increase with each call to scheduleReconnect(), increasing the time we stay disconnected.
This commit introduces a boolean flag preventing handleTeardown() to run twice or more until connect() was called again.
Change-Id: I3d7cb08d696be48532a61819fbb279a908919a3d
This doesn't treat the underlying issues and can make debugging harder if we suddenly auto-connect due to this.
Change-Id: I9c04c78e8ebda8472b0cd8c7b0b0deb2e2300139
to enable safe usage of settings no matter which process is getting/setting them.
Previously, different processes were accessing settings in an unsafe way and the warn methods were throwing Runtime exceptions which went largely unnoticed, but happened, especially on a fresh start of the OS.
Change-Id: Ie4134e7be2a7ca4a373790f45fbcbd09bf02ad86
- Update all submodules, used sdk version, etc
- Settings UI rebuild
- Some GCM features and fixes
- Fix newest Cast Framework for some apps (tested with "ZDF Mediathek")
Fixes#224, #223, #145
- Add two Google signatures to acceptable apps. Likely to increae this further
- Fix small change in GCM unregistering
- Modify intent delivery for GCM, related to #75 and #84
- Lint fixes
- Update Travis CI config
- Update build tools
- Update sublibs
- Add proper PlacePicker, fixes#65
- Add selfcheck
- Improvements to MCS connection, related #31#54
- Do not crash when permission to GPS is not granted
- Various smaller fixes
The output stream handler thread might not be alive, this occurs
reproducibly when connecting fails and a tear down is initiated.
Messages shouldn't be sent when the output handler thread is not alive
(triggers an expection which is catched but logged), this check avoids
this unless some special race condition occurs. Dropping the messages
shouldn't hurt (they were dropped anyway).
This stores the timestamp of the last ack message that has been
received. The connection is considered to be dead if the last ack
message has been received more than twice the configured interval ago.
This changes how the alarms for heartbeat pings are scheduled. Instead
of a repeating, inexact alarm that may be delayed (at least up to 15
minutes), either an exact alarm (below Android 4.4) or an interval is used
which ensures that the alarm fires between half the configured interval
and the configured interval. This interval allows the OS to optimize
alarms a bit. For Android 6.0 further adjustments are probably
necessary.
currentDelay would stay 0 if error occurs in connect() method,
resulting in busy-loop on network failures.
Fix by always calling scheduleReconnect() which contains backoff logic.
- Update Location APIs, fixes#37
- Update version number, fixes#38
- Enable long press input on WebView during login, fixes#34
- Extended log output and auto-repair for GCM connection, related to #29 and #31
- New icons
- Small quirks in Auth handling (required for Login to some applications)