If the device is in DOZE IDLE or IDLE_MAINTENANCE mode, these events can be received if we register the broadcast receiver for " android.os.action.DEVICE_IDLE_MODE_CHANGED ". But this receiver does not work when the application goes to App Standby using adb commands. Is it possible that we can programmatically check whether the application has passed the application standby mode or exited it for devices running on Marshmallow and higher?
Adb commands used to enable the app in App Standby
adb shell dumpsys battery unplug adb shell am set-inactive {Package name} true
and go out
adb shell am set-inactive {Package name} false
android android-6.0-marshmallow android-doze
kaibuki
source share