Hi,
I had the same issue. I have a dynamo on my touring bike which charges my phone at odd times. To optimize energy comsumption, I want to prevent the screen to turn on each time charging start.
I solved it with a Tasker script. Just google Tasker for android.
I made up a profile, that comes...