When I plug charger into my phone with screen off, it always turns the screen back on. This is slightly annoying at night. Is it possible to configure android so that the screen stays off and charging is only indicated via charging led? I have an HTC Desire.
It requires no permissions, but does require you giving it device admin permissions. These permissions are only used for to control device locking, as verifiable in its source-code. From quickly going through the app’s source-code, it looks totally harmless and benign.
If the app does not behave as you want, make sure to go through the Settings. For example, “Turn off screen only when locked” is enabled by default. This means that the app will not kick into effect if you have an on/off-button-press-lock delay or other related settings.
It works perfectly for my on a wireless charging pad and with micro-USB cable using a LG Nexus 4 device. I am very satisfied.
Update: I documented additional issues here.
Do you happen to have enabled
Settings > Application > Development > Stay Awake (screen will never sleep when charging)?
I am not creator of this app, but it works for me (HTC Desire Z). I have not tested it well yet, though.
I think you would need a custom kernel with this "feature" removed. I don't know of any, sadly.
As far as I can see, the only way to archive this behaviour is to switch from stock android to CyanogenMod - which does have this feature built in (under "Display & lights" menu in preferences, disable the option "Wake on plug")
I'm also searching for a solution on stock android, but it seems like that's the only way. Too bad one has to change ROM just for this feature...
There is an app by mitskiP called Screen Stay Off. I've used it for a year and it works nicely. My only criticism is that the screen turns on briefly, then turns off.
The only way I see is flashing CyanogenMod - there's a default feature for that. Don't know if this is available for HTC Desire, though.
I had a similar issue and fixed it by first turning on "developer mode" then deselecting "Stay awake" under Settings / Developer Options. Turn on developer mode by going to Settings / About Device, then touch/tap on "Build number" seven (7) times. Once developer mode is on, go to Settings / Developer Options, and deselect "Stay awake". This resolved the problem for me. Keep in mind that each android phone is slightly different in where "About Device" is located, but it is in the Settings section. Go there and tap "Build number" seven times to turn on Developer mode.
If you install Xposed, this module has an option to prevent the screen from waking when plugging into a charger: http://repo.xposed.info/module/com.smartmadsoft.xposed.aio