Search code examples
androidpower-managementwakelock

Accessing wakelock statistics in android application


I am writing a power management application for Android.

I want to be able to access wake lock statistics in my application. Details like which wake locks are active now, how many of them are partial, full..etc, which wake lock prevented device from entering sleep and so. Is there a way i can do this..?

Thanks in advance.


Solution

  • Is there a way i can do this..?

    You are welcome to track your own app's own use of WakeLock yourself. You do not have access, from an app, to data about other apps' use of WakeLock.

    Developers can use adb shell dumpsys power to see what WakeLocks are outstanding, as is illustrated in this SO question and its answers.