I know we have this very old question and answers How to keep screen turned off when plugging charger? but why isn't this implemented by Android?
My scenario is that I use my phone for navigation on my bike, and it's connected to a hub dynamo charger. The charger output isn't buffered so it will stop charging if I go too slowly (a hill or traffic lights, etc), and then start again when I'm up to speed. This can cause the screen to come on a lot. Ideally I would like to disable this behaviour. What's the current best solution and why doesn't Android have a check box to disable this annoying behaviour?