How to stop screen from coming on with intermittent charging
One of the earlier answers on this recommend using Snoozy. However it's no longer on Google Play, so you have to load the APK directly from the website mentioned.