Turn off phone by holding the power button? I've been having a small case of my screen not turning on at times. It happens on a 1 out of 100 basis. Anyway, I can confirm that the phone did not shut down because I can take screenshots (via power button + volume down key) and hear the screenshot sound. However, the display remains turned off. What I found to be the fix is to remove the battery to force shutdown the phone and re-insert it and open again.

That would have been an OK solution but my phone has 2 layers of battery cover so it's kinda tedious to do when the random screen problem occurs (especially if I'm outside or on the road). What I want to happen is that if I hold down the power button for some time (5 seconds maybe?), it will power off the device thus, saving me the trouble of having to remove and re-insert the battery.

How do I make holding down the power button for some time turn off the phone?

Phone is Sony Xperia Active ST17i, running MiniCMSandwich Lite rom with RaGe kernel.
There were those Secret Codes...


  *#*#7594#*#*: This code can be used to change the "End Call / Power" button action in your phone. Be default, if you long press the button, it shows a screen asking you to select any option from Silent mode, Airplane mode and Power off. You can change this action using this code. You can enable direct power off on this button so you don't need to waste your time in selecting the option.


Hm, guess that's what you were lokking for, right? Wanna more? OK, Here's the source, Luke: Secret Codes of Android Phones. Not sure if it works on all phones, though...