option to change double tap power to shutdown or reboot instead
Many people don't use the camera gesture and would appreciate having a quick way to shutdown or reboot compared to either using the menu or holding power for a long time for a forced shutdown.
Another useful action would be flashlight. Being able to quickly turn flashlight on/off without even turning the screen on is useful. In LineageOS I could draw a circle on the (turned off) screen to switch the flashlight on/off.
I think being able to activate Lockdown mode with this would be super helpful too.
@SaadAhmedGit Rebooting is almost always more sensible than lockscreen since lockdown doesn't return the device to Before First Unlock. It only disables secondary unlock. You can also set a 2nd factor PIN like a random 4 digit PIN for fingerprint unlock on GrapheneOS to combine a stronger primary unlock method like a passphrase with a more convenient secondary unlock method that's not possible to simply physically coerce.
The code for handling the emergency gesture (ie. calling 911) is here: https://cs.android.com/android/platform/superproject/main/+/main:frameworks/base/services/core/java/com/android/server/GestureLauncherService.java;l=579
The most straightforward way would be to add some sort of option that replaces default emergency gesture with reboot. That'll be a few lines of code in GestureLauncherService.java and some boilerplate code to configure it as a setting, but it'll also mean losing access to the 911 feature. Implementing both the default emergency gesture and also reboot is going to be trickier, mostly because the current code seems to assume that the emergency gesture is the last gesture, so adding support for 8 taps (for instance) to reboot would be trickier. It'll also make both features more finicky. Imagine wanting to call 911, but in the heat of the moment you pressed the button too many times and your phone reboots instead.
What we really need is LongPress vs ExtraLongPress.
IMO long press while unlocked behavior should remain the same, but long press while locked should pop up the emergency/power/restart/lockdown menu and if power button continues to be held after 6-8 seconds the phone should restart. I understand there's a concern about this causing accidental restarts in pocket so the behavior might need to toggleable. Regardless as was mentioned https://github.com/GrapheneOS/os-issue-tracker/issues/1308#issue-1301656495 being unable to lockdown your phone with a hardware only gesture is a major security issue regardless of your adversary, especially when fingerprint unlock is configured.
It looks like we already have LONG_PRESS_POWER_SHUT_OFF and VERY_LONG_PRESS_POWER_GLOBAL_ACTIONS so do we just need VERY_LONG_PRESS_POWER_SHUTOFF? Forgive me I'm not familiar with this code or what it looks like to make modifications/patches for graphene. https://cs.android.com/android/platform/superproject/main/+/main:frameworks/base/services/core/java/com/android/server/policy/PhoneWindowManager.java;drc=6eba2471cfe7b9d819df2303369571a2f62aceb4;l=321