title: Automated tests with Doze mode on android
body: <p>I am trying to write some automated tests for how my app functions when the device enters and exits Doze mode. I know that you can use <code>dumpsys deviceidle force-idle</code> to force the device into idle mode when doing manual testing.</p>
  
  <p>Is there a way to run that command from within a test app, or (better yet) an Android API to request Doze mode? If there isn't, does anyone have a recommendation for documentation regarding a good way to run <code>adb</code> commands at fixed points in an integration test?</p>