Any way to determine Android battery/power state (Doze & App Standby)?

hi, i’m making an app that’s designed to run in the background with minimal/infrequent user interaction.

i’m encountering issues with doze & app standby. the more i understand them, the more i’m okay with them…app standby doesn’t seem to be an issue, but doze freezes my app completely. that’s totally fine, but it doesn’t recover gracefully.

testing with adb dumpsys and adb shell am set-inactive commands isn’t reproducing the behaviour i’m getting in real-world testing.

is there any plugin or way for ionic to detect the battery/power state of a device? as i understand it, there are multiple stages a phone goes through before becoming idle.

it’d be very helpful to me to know when the device is going through those stages…anyone have any tips?