This timer uses SystemClock.elapsedRealtimeNanos to calculate the high
resolution timing value, which advances time when the device is asleep.
Fixes a bug introduced by the paho.mqtt.java library when it was changed
to track elapsed time using System.nanoTime. However, on android,
nanoTime does not advance when the device is in a deep sleep. As a
result, pings may not be sent frequently enough, resulting in client
disconnects.
[x] All of your commits have been signed-off with the correct email address (The same one that you used to sign the CLA)
[x] If This PR fixes an issue, that you reference the issue below. OR if this is a new issue that you are fixing straight away that you add some Description about the bug and how this will fix it.
[x] If this is new functionality, You have added the appropriate Unit tests.
This timer uses SystemClock.elapsedRealtimeNanos to calculate the high resolution timing value, which advances time when the device is asleep.
Fixes a bug introduced by the paho.mqtt.java library when it was changed to track elapsed time using System.nanoTime. However, on android, nanoTime does not advance when the device is in a deep sleep. As a result, pings may not be sent frequently enough, resulting in client disconnects.
See: https://github.com/eclipse/paho.mqtt.java/issues/278 https://github.com/eclipse/paho.mqtt.java/issues/774
Signed-off-by: Dustin Thomson dthomson@51systems.com
Please make sure that the following boxes are checked before submitting your Pull Request, thank you!