Is there any way to poll for the screen being off/Android?

I have an Android application and would like to conditionally run some code, but only if my phone/tablet screen is off.

Does anybody know about how to do this? I haven’t come across anything is the docs or Cordova in my own searching.