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 dumpsys deviceidle force-idle
to force the device into idle mode when doing manual testing.
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 adb
commands at fixed points in an integration test?