Kronos-Android icon indicating copy to clipboard operation
Kronos-Android copied to clipboard

Use boot count to detect reboot if it exists

Open Rajin9601 opened this issue 3 years ago • 2 comments

to fix #61 related to https://github.com/lyft/Kronos-Android/issues/61#issuecomment-1035936886

Using the difference between deviceCurrentTime and deviceElapsedTime can trigger false negative on isFromSameBoot. To avoid this false-negative case, this PR uses boot count from Settings.Global.BOOT_COUNT.

For case when bootCount is not available to the device (e.g. without Android or android sdk below 24) this PR uses bootCount only when it's available. When there is no bootCount, it uses the same algorithm that has been used before this PR.

Rajin9601 avatar Feb 11 '22 08:02 Rajin9601

This is a great find! I never knew this setting existed. Curious to know how well this might be working with testing.

jh0719 avatar Feb 11 '22 17:02 jh0719