Open martinfilipekcz opened 6 years ago
That looks 10x better than boot receiver solution (which doesn't really work). I'm assuming using /proc/sys/kernel/random/boot_id is safe on Android devices? Any idea of some Android versions where this is not supported?
I cant tell if it is save on every device only thing that I know is that from M api version you cant access /proc/sys/kernel/random/boot_id but for that is there logic with BOOT_COUNT. We are using it in our app(about 11k users) and doesn't seem single crash.
DISK_CACHE_CLIENT.cacheBootId(bootId.toString()); clearCachedInfo();
this is mistake, first record, followed by purification
+1
DISK_CACHE_CLIENT.cacheBootId(bootId.toString()); clearCachedInfo();
this is mistake, first record, followed by purification
clearcacheInfo does not clear bootId
_cacheInterface.put(KEY_CACHED_BOOT_TIME, bootTime); _cacheInterface.put(KEY_CACHED_DEVICE_UPTIME, cachedDeviceUptime); _cacheInterface.put(KEY_CACHED_SNTP_TIME, cachedSntpTime);
I have run into this issue in the app I'm working on and going to test this change out shortly. I see that this PR has been sitting for quite a while and wondering if this change is not going to make it in or if I'm going to have to do something custom in the app. Any thoughts?
+1
@martinfilipekcz 🙏 thank you for the suggestions. I apologize for this PR going stale. TrueTime has since undergone massive changes with the migration to Kotlin + Coroutines. We've picked it back up and are revamping it in earnest.
/proc/sys/kernel/random/boot_id
file is probably blocked.Would you be up for trying to implement the solution you suggested via BOOT_COUNT
and shooting a PR up for this? You might have to abandon this PR as the 4.0
is a complete overhaul (apologies in advance for this).
I do not know where to put the method exactly. Feel free to put it where it's the best place by you. Problem is with custom CacheInterface implementation. But the basic logic is there.