Found this very interesting article about how Android’s Doze Mode really works and how you can tweak the settings. For example how you can make doze mode ignore the motion sensor.