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).
Asked
Active
Viewed 649 times
2
-
Source code of M preview will be helpful, but until now can't find (probably not public). Google source from branch android-m-preview doesn't corresponds M preview binary image published officially. – Jokii Jun 30 '15 at 07:33
1 Answers
1
You need to have android.permission.DEVICE_POWER
(signature protected) to call the method. See the source code:

Mygod
- 2,077
- 1
- 19
- 43