New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
we don't need to *also* store the boot time #18
Comments
We do need to cache boot time right? It may change when the device is On Mon, Sep 19, 2016 at 3:37 PM, Kaushik Gopal notifications@github.com
|
I think we don't need to cache uptime instead, since it should be cheap to read, and we'll want the latest version every second. |
That's right, we would need to know the last boot time but this can easily be derived by
yup, that's right too but rather than checking on every app resume (which would include after app kills for e.g.), we can listen to "boot" events, which is what the boot broadcast receiver does. On every boot we clear the disk cache, so the case you mentioned is accounted for. But we get the advantage of not having to check this on every app resume. just device boots. |
we'll need the uptime at the point that sntp was generated. Or alternatively, we could store the boot time (either would work) |
Cool. Does the boot broadcast still get delivered even if the app is not running, and then processed after app resume? |
so my understanding is that the boot broadcast would be received if the app was ever launched atleast once. i.e. if it was never launched then it wouldn't receive the broadcast. but if it was launched once, then we should be getting these. i tested this with a basic boot case |
Probably does not always work this receiver, error log reports show similar:
|
@Bakhrom : i would encourage you to open a different issue on this. (might be a faulty NTP server ? In that new issue please give me details like which ntp pool server your using and if you've pulled the latest code) |
i'm closing this issue out, cause i'm not enthused at the moment to change it. i'm open to PRs: :P |
boot time = sntp time - device uptime. we shouldn't have 3 flags
https://github.com/instacart/truetime-android/blob/master/library/src/main/java/com/instacart/library/truetime/DiskCacheClient.java#L12
The text was updated successfully, but these errors were encountered: