essentials
essentials copied to clipboard
ObjectCache should use phone uptime instead of time
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()
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.
agree