Skip to content
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

Removed boot receiver. Added reboot handling by boot id. #93

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

martinfilipekcz
Copy link

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.

@mmitic-lotusflare
Copy link

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?

@martinfilipekcz
Copy link
Author

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.

@gerc99
Copy link

gerc99 commented Apr 29, 2019

DISK_CACHE_CLIENT.cacheBootId(bootId.toString()); clearCachedInfo();
this is mistake, first record, followed by purification

@karangoel16
Copy link

+1

@karangoel16
Copy link

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);

@mhenhoeffer
Copy link

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?

@vandus
Copy link

vandus commented Sep 24, 2019

+1

@kaushikgopal
Copy link
Collaborator

kaushikgopal commented Mar 10, 2023

@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.

  • I agree that the current boot receiver solution is 💩 and so shouldn't be used.
  • I had the same concern as your second comment viz. access to the /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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants