lundi 29 juin 2015

How can I access IDeviceIdleController instance in Android M

I'm exploring the changes in Android M preview release 1. Specifically, I want to know if I can programmatically check to see if my app is whitelisted from Doze and App Standby mode. I basically want the result of "adb shell dumpsys deviceidle". I attempted to get the instance of android.os.IDeviceIdleController via getSystemServices but it return null. when I do "adb shell service list" I get "56 deviceidle: [android.os.IDeviceIdleController]". If I can access the instance, then I an use java reflection to access the public method isPowerSaveWhitelistApp(string name).





Aucun commentaire:

Enregistrer un commentaire