I flashed GrapheneOS some days ago and installed the Tap Tap app to be able to toggle the flashlight by touching twice the back of the phone. I set the battery optimization to unrestricted so that it can run in the background.
However, when I turn off the screen, the gesture only works for some seconds and then becomes unresponsive. The app is not being killed as the process is still running and the indicator in Quick Settings says so too, so I think that it is one of the sensors (accelerometer or gyroscope) that the app uses to work properly which stops running when the screen is off.
Do you know what could I do for it to work always? Thanks in advance.