my app uses the commonsware wakeful pattern to wake the device up at a frequent (5 minute) repeating alarm interval. I know waking this frequently maybe the root of my problem, but the actual work done when the device wakes up is minimal and the code executes very fast. On a certain version of android (4.1.2) on certain devices (eg Xperia T), the app gets nailed in the Settings > Battery Use list as a high battery user. However, in all other versions/devices I've tested, the app doesn't make it into this list, even if I use a more agressive interval of 1 minute!
Is there a known bug around battery stats in 4.1.2? I can't find any related bug reports. From looking at the source code, I can see the wakelock gets released here, but the battery stats get updated outside the wakelock here. Is this a bug?
There seems to be a large amount of changes in the PowerManagerService's current code, but just wondering was this bug fixed?
Anyone else experiencing this? Any ideas on how to poke the system to update its battery stats after the wakelock is released?
Dom