Power-off alarm not working when phone connected to power source
- /e/ version: /e/OS 1.4-20221013225888 (but also occurred on all previous versions since power-off alarm was introduced)
- Device model(s): Fairphone 3 (FP3)
- Device rooted: no
Summary
Thank you for implementing power-off alarm, it's pretty great to be able to turn off the phone! However, it doesn't work properly when the phone is connected to a power source.
The problem
Steps to reproduce (I can reproduce this consistently)
- make sure the alarm app has the permission to set power-off alarms
- connect the phone to a power source (this can also be moved right after the "turn off the phone" point, it's not relevant, provided that the alarm is set enough minutes in advance)
- set an alarm two or more minutes in advance
- turn off the phone
What is the current behavior?
Since the phone is connected to a power source, as soon as it is completely powered off, the screen suddenly turns on again for some seconds to show the current battery level. Then it won't ever turn on again and the alarm will be missed, which is obviously an unwanted behavior.
What is the expected correct behavior?
The phone should turn on at the specific time to let the alarm ring.
Technical informations
I don't know how to collect logs while the phone is turned off, and I don't know how to collect low-level logs about the power-off alarm. In case you need some logcat logs, I can provide those, though I don't think they would be useful, since they can be obtained only while the phone is on afaik.
Solutions
Workaround
I did not find any workaround yet, other that disconnecting the phone from power (but then the phone won't charge during the night, so this is not a valid workaround).
Possible fixes
I think the problem is caused by the fact that the internal power-on timer set by the alarm app gets dismissed when the screen of the phone turns on to show the battery status. I think the "screen turned on to show battery status" ought not to be considered as a "phone turned on" event, and ought therefore not to clear the internal power-on timer.