I am developing a custom Android ROM and I have a trouble with a force shutdown.
In devices that do not have a removable battery a long press (over 10s) of shutdown button should shutdown the device.
In my ROM this always happens, but the device sometimes enters a strange fastboot state, where you have to again long press power button to exit it.
I dont have a clue where is this feature implemented and would really appreciate some directions. I dont even know if I should search in kernel or userspace.