This is because the calls to the power management APIs in Android are private and not exposed to the developer. These APIs are only available through Reflection.
The main packages that are used internally by Android regarding getting statistics from power management are held into com.android.internal.os.*
(such as com.android.internal.os.BatteryStatsImpl
).
StackOverflow user Chris Thompson shared a repository containing tools and an app for handling what you want. You can find it here.
You can inspire yourself from what he did and build something on top of that.
Also, it seems that you can get advanced battery statistics and CPU load used by each app using adb shell dumpsys batteryinfo
.
A simple strace dumpsys batteryinfo
while you are in adb shell
might give you a hint on how these informations are retrieved by dumpsys
.