GrapheneOS / os-issue-tracker

Issue tracker for GrapheneOS Android Open Source Project hardening work. Standalone projects like Auditor, AttestationServer and hardened_malloc have their own dedicated trackers.
https://grapheneos.org/
365 stars 21 forks source link

Temporary Keep-Awake #1007

Open LukeAbellSmith opened 2 years ago

LukeAbellSmith commented 2 years ago

A drawer widget would be ideal. It is possible to achieve a similar result by going into settings and changing the sleep timeout if the user is in a safe location where having the device unlocked poses no risk, but then the user needs to remember to set the timeout shorter again when leaving so as to not compromise security by forgetting and leaving the device unlocked and unattended.

ph00lt0 commented 2 years ago

You could probably just just app-pinning for this. That will also limit the risk that someone opens different apps if left unattended. @LukeAbellSmith. Leaving the device fully open never really is a good idea.

https://support.google.com/android/answer/9455138?hl=en

LukeAbellSmith commented 2 years ago

It's pretty safe if I'm home alone. Also if you're arguing that, the maximum screen lock timeout should probably be reduced from 30 minutes.

chwallen commented 2 years ago

You could probably just just app-pinning for this.

App pinning does not prevent the screen lock timeout, so it is unfortunately not a work-around.

Leaving the device fully open never really is a good idea.

If I am in my kitchen following a recipe and I want the screen to remain active for 5 or 10 minutes (or a similar scenario), this is really useful. It is annoying having to either repeatedly tap my device to keep the screen active (with possibly dirty fingers), or temporarily change the screen timeout period to 10 minutes and always forgetting to turn to back down.

lazytownfan commented 2 years ago

This is the one Quick Tile setting that I miss from LineageOS (which can toggle between 5 minutes, 10 minutes, 30 minutes, and ∞).

Currently, I have to use the Coffee app on GrapheneOS. It's the only FOSS app that's currently maintained (that I'm aware of) and it works acceptably, though the Quick Tile only toggles between being turned on forever or it requires you to turn it off manually. It's also not as fast as Caffeine on LineageOS, though I suspect this behavior happens since Coffee is just a normal app and isn't a system-wide app.

Sometimes I need to prevent my device from sleeping for a few minutes in a scenario where I have low security needs, such as if I need to quickly reference contact info to a computer or when I'm drawing from a reference picture. I'm still present and aware of my device - I just don't want to rush to prevent my phone from sleeping every 2 minutes (or whatever people have the sleep time to).

Edit: The Coffee app works acceptably well on modern Android OS's, such as GrapheneOS (currently on Android 13, at the time of this edit, though this is an app-level solution and not a system-level solution).

lokesh-krishna commented 1 year ago

Could this work by offering a quick settings tile for the screen timeout itself? So that one doesn't need to dig into settings for it and resetting it would just mean setting it back to whatever value one usually uses.

russianbot91 commented 1 year ago

I've found this this app works almost as well as the one included with LineageOS.

https://apt.izzysoft.de/fdroid/index/apk/tr.edu.iyte.caffeine

There is one in the official F-Droid repositories that's only 11kB, but it doesn't work on modern versions of Android.

sevmonster commented 1 year ago

I needed to keep the screen on while driving (reading navigation) and was sad to see that Caffiene, which has been in every custom ROM I've used in years, wasn't present the only time I truly needed it. I ended up adjusting the screen timeout from Settings at a stoplight.

https://apt.izzysoft.de/fdroid/index/apk/tr.edu.iyte.caffeine

This didn't work for me on Pixel 6 Pro with most recent Graphene.

Coffee as mentioned above has also added a "Next timeout" quick tile, which has the time increments like Caffiene. It doesn't go to infinite as a final step though so it's still not a drop-in replacement. Though, maybe this is a good thing.

girlbossceo commented 1 year ago

I needed to keep the screen on while driving (reading navigation)

Whatever app you're using needs to be written in a way to keep a wakelock for this like normal navigation apps (e.g. Google Maps).

If the user has to keep the screen on for driving navigation themselves, this is unsafe and the developer needs to correct this. This isn't hard for them to implement.

sevmonster commented 1 year ago

Whatever app you're using needs to be written in a way to keep a wakelock for this like normal navigation apps (e.g. Google Maps).

It was a text document, not navigation app. Point me to a text reader that supports wake lock and I'll gladly try it.

lokesh-krishna commented 1 year ago

ReadEra does

Svintooo commented 1 year ago

Yesterday I switched back and forth between phone and computer constantly, looking stuff up and then trying things out on my phone. And everytime I switched to my phone I had to unlock it. It got annoying pretty quickly.

Changing the screen timeout here felt insecure since I would easily forget to change it back later. With something like caffeine I could have changed the timeout temporary, which would have felt more secure.

sevmonster commented 1 year ago

Do try Coffee, it works well for me.