sweakpl / qralarm-android

QRAlarm is an Android alarm clock application that lets the user turn off alarms by scanning the QR Code.
GNU General Public License v3.0
116 stars 10 forks source link

Support Direct Boot (alarm before first unlock) #34

Open secretmango opened 8 months ago

secretmango commented 8 months ago

The alarm clock does not do anything if the device rebooted and it not yet unlocked.

I am not sure if the Camera could work here, so this alarm clock could be fundamentally incompatible.

But if you device reboots, for example on GrapheneOS where auto-reboot is used as a security measurement to clear the encryption keys from RAM or with automatic system updates with reboot, the clock would not go off.

The AOSP clock as well as new-clock support direct boot, so they display the alarm on top of even the SIM card lock screen after a reboot.

sweakpl commented 8 months ago

Hey, thanks for reporting! I'm aware of this problem and actually at one point QRAlarm was considering direct boot. It has become problematic because of the use of the Jetpack DataStore framework which was trying to use the encrypted storage scope which was causing a crash.

Here is the Google Issue Tracker thread in which I reported my problem: https://issuetracker.google.com/issues/273326519

I've tried using the direct boot safety measures like Context.createDeviceProtectedStorageContext() which didn't work at that time and thus I've decided to, unfortunately, stop the support for direct boot in this commit.

I still must admit that I might have not entirely explored the direct boot functionality so I would probably look into that issue again in the future.

secretmango commented 8 months ago

Thanks for the response!

phanirithvij commented 6 months ago

That bug on Google issue tracker was marked as won't fix.