essentials icon indicating copy to clipboard operation
essentials copied to clipboard

ObjectCache should use phone uptime instead of time

Open andrew-ld opened this issue 2 years ago • 2 comments

Currently ObjectCache depends on the system time never changing, which is not optimal in a setup where the app runs for a long time, the user or the system might change the time.

a solution would be not to use the time but the uptime of the phone.

https://developer.android.com/reference/android/os/SystemClock#uptimeMillis()

andrew-ld avatar Nov 05 '21 10:11 andrew-ld

That API is only available on Android. I guess that's why System time was chosen.

Might make more sense to switch to the new Java 8 Time APIs and allow to supply a custom clock.

greenrobot-team avatar Nov 09 '21 14:11 greenrobot-team

agree

andrew-ld avatar Nov 09 '21 14:11 andrew-ld