yashsingh1/xdaforums huggingface dataset:
[BetterBatteryStats] chamonix:
The problem was the cache. The caching strategy of BBS is to cache the binder to batteryinfo, including the associated parcel (kind of serialized data object). Why do I do this: to avoid making too many calls to batteryinfo in a row like when, e.g. the dump is created (this causes about 50 calls to retrieve all the values).

The cache of course is not permanent to make sure that values change when you refresh of change stat type. Now the problem with the 100% charged is that some counters are reset when the phone is unplugged and the battery is fully charged. At unplug and 100% charged two refs are saved (since unplugged and since charged) and the logic before the fix did not make sure that the cache got flushed before saving the ref. This lead to sometimes (most of the times) the references being saved with the couters prio to the reset. This in turn lead to negative values during the next calculation (substract ref value from current). E.g. with deep sleep: value in ref would have been 10 hours in 15 hours, and the "current" value after the rest 0s in 10s (right after the unplug).

The fix is to always flush the cache before writing any reference so that only "current" can be delivered by the cache.
[BetterBatteryStats] chamonix:
Please be more specific, tell me the steps (what do you kill, service or app, with what tool) and what you see, provide a logcat and a dumpfile and I will have a look. As long as I can't reproduce there is now way I can fix anything.
[BetterBatteryStats] bgdave:
Network coverage is bad where i am at, but it has never caused me to get bad battery until now. I have seen 12 hrs with 2 hours screen on in the past with having location enabled, Google Now activated, and Exchange active but have only just began to see the bad battery across multiple ROMS.

Phone was indoors, no sun, no cold.

I disabled all maps autostarts and am still seeing NetworkLocationLocator keep me phone awake 20% of the time. Oddly enough though, Exchange has been fine today.

These new JR000 Jelly bean builds are zany to say the least.
[BetterBatteryStats] bordikun:
Tried stopping apps to auto start but same result. Overnight 10hrs+ battery drain is 20%+ (Mobile Data ON and Sync ON). Followed Karpfenhai guide via autostarts of GSF.

Don't mind Lightflow I have that for a while it does drain your battery a little but this app is very useful to me :)
[BetterBatteryStats] Vahooli:
networkstats

its my dump file , can anyone help me wht cause of netwrokstats in partial wakelock eat my battery !?
[BetterBatteryStats] pXel:
Good job!
[BetterBatteryStats] Karpfenhai:
This is your problem..

EM/android_talkfd4ef7602d23 (Google Services): 12 m 51 s (771 s) Count:3725 2.0%

GTALK_ASYNC_CONN_com.google.android.gsf.gtalkservice.AndroidEndpoint (Google Services): 8 m 32 s (512 s) Count:3528 1.3%

GTALK_CONN (Google Services): 1 m 29 s (89 s) Count:3311 0.2%

And this sucks your battery empty...

Try to fix that, Lightflow is an Orphan-boy against this! (German Idiom ;P)

---------- Post added at 02:37 PM ---------- Previous post was at 02:35 PM ----------

Sorry mate, this dump is out of support since it is not a clean idle dump!

Read the Opening posts ( #3) how to produce a good dump. and come back, thanks!
[BetterBatteryStats] bordikun:
I did notice that earlier after testing for hours. I tried to disable "Talk" App, and it was the problem. Now I cleared the cache of that App and will see how it works.
[BetterBatteryStats] kami2k:
How battery is increased with out charging? lololz
[BetterBatteryStats] PedroKantor5234:
Hi, I keep getting a partial wakelock called AudioOut_3. At first, I thought it was related to the common Audio_out 1, so I tried to solve it using the methods people posted to solve audioout_1. Unfortunately, the problem still persists and I have no idea which app is causing this problem, does anyone know how to solve this partial wakelock? (I also don't know how to post a dump, if anyone could help me out I'd be grateful:o)
[BetterBatteryStats] kami2k:
its your email sms notifications, disable the sound and put vibrate only and you will see
[BetterBatteryStats] Vahooli:
i didnt find how to clean dump but now i edit it i hope u can read it easily :) my problem is Networkstats and Power manager...
[BetterBatteryStats] chamonix:
Release 1.11RC5

Lastest RC is up with a few fine tunings and last changes. This should be the golden release.
[BetterBatteryStats] drahmed86:
wonderful!!!! i like battery drain per hour add-on.

---------- Post added at 05:37 PM ---------- Previous post was at 05:27 PM ----------

+100
[BetterBatteryStats] Karpfenhai:
Its all about chemistry.. but im too lazy to repeat how and why, just search.. completely normal..

Mate .... We need an idle dump to divide the overhead, its not easy to find the difference between wanted and unwanted wakelock activities... Therefore please provide an idle Dump! Got it? no offense..

But, you had about one hour overhead in your dump, minus 20 mins you actually called, there are only 40 mins left, which is not too bad..

Thx, will test now ;)
[BetterBatteryStats] kingofcomedy:
Maybe someone can have a look at my dump again? :)
[BetterBatteryStats] alexinna:
Agree. The only thing after couple of hours it's still shows 0.0.

What do I need to do to trigger calculation?

---------- Post added at 09:15 PM ---------- Previous post was at 09:07 PM ----------

Would be nice if you can review ProfiMail because it wakes your device a lot. Also Wi-Fi was up and running almost all the time that was causing

"wlan_rx_wake" (): 1 h 58 m 17 s (7097 s) Cnt:(c/wc/ec)6379/0/6379 5,4%
"wlan_ctrl_wake" (): 16 m 58 s (1018 s) Cnt:(c/wc/ec)1136/0/1136 0,8%
"wlan_wake" (): 1 m 16 s (76 s) Cnt:(c/wc/ec)154741/3250/0 0,1%

. I would suggest to only run it when needed (look at post #3). Did you listen to any music

AudioOut_2 (1013): 29 m 41 s (1781 s) Count:272 1,3%
[BetterBatteryStats] bobdoblo:
Be nice if a normal person could make sense of what keeps phone awake!

Why does it not just give name of app+times woke+total time.?

Sent from a telephone
[BetterBatteryStats] RovG:
:thumbup: Agreed!
[BetterBatteryStats] bataya:
Just to say tnx for rc5, it is gr8 when developer listen user sugestion. :)

sent by tt
[BetterBatteryStats] chamonix:
Normally nothing. Could you please check in logcat for TAG StatsProvider and events around

Battery Level since
[BetterBatteryStats] kingofcomedy:
Thanks for your answer. Maybe I should turn off Wifi while the device is in stand by-mode? And I didn't listen to any music. I was wondering about this "AudioOut_2"-part too.
[BetterBatteryStats] bobdoblo:
How do i get a dump off BBS?

Sent from a telephone
[BetterBatteryStats] Lebenita:
Menu key / More / Dump to File
[BetterBatteryStats] bobdoblo:
I did a 7 hour file but i have been using the phone in the last 30mins, does that matter?

Sent from a telephone
[BetterBatteryStats] numb_:
Hi guys, can someone take a look at my dump file and tell me if any improvement is possible? I'm a little bit confused about GTALK_ASYNC wakelocks, it's normal?

Dump File

Thanks!
[BetterBatteryStats] RovG:
Hi Chamonix,

Latest version is looking good.

I have the folowing enhancements / feature requests for your consideration:

1. Add a new tab under package info to show an apps broadcast receivers and then intents per broadcast receiver similar to screen shot below from autorun manager. This will help in identyfying the appropriate receivers contributing to wakelocks so that we may disable them.

2. Could we have a mv/h similar to %/h. My device when properly tweaked can stay at 100% for several hours but will drop 78-110 mv. Perhaps a second line similar to the current one but with:

Bat.: 3987mv (4200mv to 3987mv) [78 mv/hr]

3. I Notice that there is no icon for Android System. Would it be possible to display the same icon as in the default android battery history.

Tks
[BetterBatteryStats] RovG:
as per screencap below
[BetterBatteryStats] Rob2222:
Hello Chamonix,

%/h is not working yet for me. I get a 0,0%/h value. (time and percent are working well)

Another S3 user reported the same problem in a german forum.

But I am using S3 Stock Jelly Bean leak, I don't know if that matters.

BR

Robert
[BetterBatteryStats] TA123:
I've got CM10 on SGS2 and it drains battery quite a lot on standby. This night for example it consumed more than 20% in 8 hours. I wonder if it's possible to tweak something to make it less power hungry. I had pretty much the same setup on CM9 and it drained only 1% an hour. Just if someone could have a quick look at my stat dump. (Oh, can't find how to upload file in xda app, will edit the post in a minute in browser).
[BetterBatteryStats] chantoine:
Read post #3 for location services... and cuf off WiFi while in standby.
[BetterBatteryStats] Karpfenhai:
Really ?? Its sooo obvious...

Partial Wakelocks

======================================================

NetworkLocationLocator (com.google.android.apps.maps.Maps): 30 m 36 s (1836 s) Count:938 5.7%

NetworkLocationPassiveCollector (com.google.android.apps.maps.Maps): 3 m 5 s (185 s) Count:1687 0.6%

LocationReceiverService (com.google.android.apps.maps.Maps): 1 m 28 s (88 s) Count:3025 0.3%

CheckinsNotificationService (com.google.android.apps.maps.Maps): 1 m 18 s (78 s) Count:2259 0.2%

AsyncCollectorListener (com.google.android.apps.maps.Maps): 27 s (27 s) Count:4293 0.1%

NLP PendingIntent client in com.google.android.apps.maps (com.google.android.apps.maps.Maps): 5 s (5 s) Count:3566 0.0%

NetworkLocationCacheUpdater (com.google.android.apps.maps.Maps): 3 s (3 s) Count:202 0.0%

AlarmManager (com.levelup.beautifulwidgets.Beautiful Widgets): 1 m 6 s (66 s) Count:535 0.2%

Alarms (requires root)

======================================================

com.google.android.apps.maps (): Wakeups: 918

ccc71.bmw (): Wakeups: 536 --> Disable Battery Monitor widget or set it to less update frequency

2 possible Solutions here, first, sign out all location based services and disable ALL Autostarts from maps. Second, revert to an older Version of maps since the scanner Problem is an ongoing (and reported) Issue with maps.

See post 3, as stated before.

Good luck!
[BetterBatteryStats] Aleq:
Hi Everybody,

I'm having quite significant battery usage by Google Maps with Latitude, is this normal? Do others with Latitude experience the same thing? Running on SGS2 i9100 with quite recent daily build of CM9 + Dream Kernel, latest Maps. Screenshots are after a night. There are 4 Google accounts registered in the system, 3 of them do have enabled gmail sync, one with everything enabled. There are 5-7 active Latitude friends in the Maps.

Is there any way to make it better but keep the Latitude on? This is sad...

Thanks for looking.
[BetterBatteryStats] bobdoblo:
How do i disable map autostarts or get older version of maps?

I want a 2Ghz Quad core monster with 4GB RAM, so i can disable 3 cores and uc it to 800mhz to save battery!
[BetterBatteryStats] loadgamzone:
Thank you
[BetterBatteryStats] alexinna:
Here it is:

D/StatsProvider(20151): Battery Level since 3:100
D/StatsProvider(20151): Battery Level since 3:20

My logcat attached. Thanks.
[BetterBatteryStats] drahmed86:
+100
[BetterBatteryStats] bgdave:
After much tinkering I have solved my problem. I used WugFresh's Nexus Toolkit and flashed stock Rom and unrooted, then rerooted and flashed new custom Rom. Voila, wakelocks have ended and my phone is deep sleeping like a baby. Left it off charger last night while I was asleep with Full data on 4G, exchange syncing, GPS on and Google Now reporting, and battery dropped only 12 percent in 7 hours which is about what I was used to before the problem. Exchange and maps both showed nowhere near the top of my wakelocks as they had been.

I flash a lot of ROM and somewhere down the line, something got screwy that a Data wipe and cache clear just would not get rid of. Hopefully this info helps someone else.
[BetterBatteryStats] Rob2222:
Is this enough information?

BR

Rob
[BetterBatteryStats] foosion:
That link includes "The only way to prevent those wakelocks is tu switch of "Google's location service" under settings.

Not much of a solution though..."

The only other suggestion I've seen is to downgrade to an earlier version of google maps, which is not much of a solution either. Has anyone come up with anything better?

In addition to SignalCollector.ScannerThread, maps is also generating NetworkLocationLocator and NetworkLocationPassiveCollector. Are these the same issue or is there another cure for these other two?
[BetterBatteryStats] chamonix:
#285

#286

The problem is that there is no valid icon for the package associated with that UID
[BetterBatteryStats] chamonix:
Got it, my bad. The calculation of the ratio was the problem leading to value tending toward 0 with increasing runtime.

New RC wlll be here in a few minutes
[BetterBatteryStats] chamonix:
Release 1.11RC6

New release is up fixing two bugs. See post #2 for the changelog
[BetterBatteryStats] Noed:
In Kernel wakelock view, what these counts stand for? (c/wc/ec)

These are counts of alarms caused by Kernel?

(Sorry, I did search forum and google before asking, but got many mismatch results since dumps always have this string c/wc/ec)
[BetterBatteryStats] Karpfenhai:
Count per hour is working now, thx sven!
[BetterBatteryStats] chamonix:
Count/wake could / expired count

More details here: http://elinux.org/Android_Power_Management#Sample_.27cat_.2Fproc.2Fwakelocks.27_output
[BetterBatteryStats] Noed:
Thanks a lot for this.

I had a couple problems trying to disable them...

On Gemini, I disable the "CHECKIN", then when I look again it's enabled. I can't disable it.

On Autostarts, it doesn't show any of the items you have in your screenshot after the "Secret code entered".

Then I installed the app "Autorun Manager" from Google play, great app a lot more detail than Gemini and Autostarts. Is it safe to disable all "Checkin" receivers? (CheckinService$TriggerReceiver, CheckinService$Receiver and CheckinService$SecretCodeReceiver)
[BetterBatteryStats] Rob2222:
Thanks! :)

You don't calculate %/h for raising percentage (charging), right?

Could you maybe do it or does it give any incorrect information in any state?

Would be useful for some battery capacity calculations. ;)

EDIT: Ah, I see the cause, "since" is not working (is 0) when connected. But I think this are the things, why "enable while charing" is for advances users only. No problem, thats not important.

BR

Robert
[BetterBatteryStats] Karpfenhai:
basically its try and error ;) you can try it, but maybe market purchase will fail, remember what you disabled last, im pretty interested in your results!
[BetterBatteryStats] chamonix:
Correct. Batteryinfo is locked and counters frozen as long as power is connected no there is way to get reliable info for since as batteryrealtime stops counting
[BetterBatteryStats] Rob2222:
Not even with a systemtime timestamp from a custom reference for %/h value? :) :angel:

OK, I see (think) the implementation work for this special case it not worth it, just to get %/h without calculation. ;)

BR

Rob
[BetterBatteryStats] dalanik:
Hello

recently I installed JellyTime on my good old DHD and noticed huge battery drain. I use more or less same apps for the last 1 year and have never notices such drain on any other ROM. I had a feeling when I returned to Sense/Gingerbread ROMS that battery was fine again, but again, this was only my feeling. I am noticing huge drain with screen on (like 12% for 10 minutes!!) but what's weirder, there is drain even when device is screen off (locked), and through battery stats it show 2 things that use it most are screen (ofcourse) and media (media scanner I suppose).

I also noticed that device charges way to quickly, i.e. in time it took me to write this post, it went from like 60% to 72% (10 minutes??). Seems to me battery is going crazy :)

I have a BBS log and screenshots, would any kind soul with better understanding of the problem in question have a look and advise what to do?

cheers,

D>
[BetterBatteryStats] chamonix:
Blieve me I would. But as you remember the problem with negative values in 1.10.x was introduced by me using a different approach to calculating runtimes without using batteryinfo. I have since then reverted all changes because the only valid time ref for batteryinfo is its own time ref. Any other method will lead to corrupted values and a lot of support so I am not willing to try any hacks on that one.
[BetterBatteryStats] Karpfenhai:
I would suggest to wait another cycle, since your media scanner was active amost 40 mins, this plus maps are your main culprits.

Good luck!

Tapatalked from my Samsung GT9100
[BetterBatteryStats] kevindd992002:
What do you mean by #285 and #286? I tried reading posta 285 and 286 but I don't see the relation to his question?
[BetterBatteryStats] Rob2222:
Try this:

https://github.com/asksven/BetterBatteryStats/issues/285

and that:

https://github.com/asksven/BetterBatteryStats/issues/286

;)

BR

Rob
[BetterBatteryStats] kevindd992002:
Thanks :)
[BetterBatteryStats] noobguy1234:
Please help with AlarmManager wakelocks issue (thread linked)

Hi there,

I am a complete newbie who found this thread while trying to fix my phone (screen keeps turning on randomly). I found AlarmManager has the most wakelocks when I ran BBS, but I can't find the particular app that is causing it. I know that this has been mentioned many times, but I am a complete noob at adb/Gscript and whatnot.

I have simply linked my thread here since I have detailed all the steps I tried, and the post is quite long.

http://xdaforums.com/showthread.php?p=31931007#post31931007
[BetterBatteryStats] Noed:
Thanks, I've disabled those "checkin" receivers, everything still working so far... Will observe if gsf alarms reduce.

SGS2 RR307 Siyah415
[BetterBatteryStats] noobguy1234:
A little update on this. I finally figured out how to adb code. The problem was I typed it all in one line, instead of typing "adb shell" first then the rest.

Here are the dump files from bbs and the alarmmanager

Can someone please help me interpret what is causing all the wakelocks?

Thank you
[BetterBatteryStats] bordikun:
I don't really understand what this is:

GTALK_ASYNC_CONN_com.google.android.gsf.gtalkservice.AndroidEndpoint (Google Services): 1 m 30 s (90 s) Count:172 0.3%

I already disabled Google "Talk" App and disabled autostarts of GSF. But this wakelock still appear. T_T
[BetterBatteryStats] bobdoblo:
Don't know how to upload dump so i will just have to tell you.

7mins 52sec out of 8hour 50mins awake is good right?

Or should it be even lower?

Only lost 1% battery!!!

I'm on NeatROM 3.3 with Siyah 4.1.4

I want a 2Ghz Quad core monster with 4GB RAM, so i can disable 3 cores and uc it to 800mhz to save battery!
[BetterBatteryStats] Hilmesh:
Please see attached changes i did with Google services framework with reference to Karpfenhai's post. The attached changes are not complete as per his post. changing anything else than what i have changed is leading me to losing Gmail auto sync. Furthermore i lose the ability to Start Autostarts, my phone keeps getting reset every time i try to start it. But with only the attached changes there is no issue. hope this helps.
[BetterBatteryStats] gollyzila:
Thanks, I was having the same issues too. I'll try this out.
[BetterBatteryStats] bordikun:
Can you tell me what APP is that for the first 3 images? Thanks!
[BetterBatteryStats] RovG:
Gemini App Manager.
[BetterBatteryStats] Vahooli:
:) now i try too make a good dump ! however im not at home and its since boot with just 8min screen on and damn networkstats !

really networkstats make me crazy ! its really eat battery !
[BetterBatteryStats] alexinna:
Fix works! :good:
[BetterBatteryStats] Karpfenhai:
Yeah you did a pretty good job, congrats!

RILJ (Phone): 32 s (32 s) Count:326 2.0%

This might be the issue, doeas your RIL Match to your modem?

Maybe you can try the GETRIL app to figure out.

Or read this thread here --> http://xdaforums.com/showthread.php?t=1881304

Good luck!
[BetterBatteryStats] Noed:
chamonix, a small feature request I guess would be useful for a lot of people:

In "Other" view, add a stat for:

Awake - (minus) - Screen On

That means, how long the phone is awake while the screen is off, something we want to balance in general to improve battery usage.
[BetterBatteryStats] bordikun:
Yeah that would be great, I always compute that Awake - Screen On to know the real total time of Awake time.
[BetterBatteryStats] Vahooli:
thnx for ur answer ... now i try this app :)

but is there any relate between ril and networkstats ? cz ril is 32S and networkstats and powermanagerservice are 18 min !

how about i will do ur opinion :)
[BetterBatteryStats] Tungstwenty:
My 2c as well...

It looks like the screen off time and the "phone in use" time overlap, at least according to the sources.

I don't know how big a problem that could be, but here are some random thoughts on on how to get a better measurement:

3 possible reasons for the screen to switch off: user, timeout or proximity. source

The BatteryStatsService is warned about the screen going off, but isn't informed of which of the reasons (which could be useful to ignore the proximity reason). source

Unfortunately, it doesn't look like the screen On/Off broadcast sends the reason to the receivers :( source

Perhaps there are wakelocks with flag PROXIMITY_SCREEN_OFF_WAKE_LOCK instead of PARTIAL_WAKE_LOCK, that could be found by interrogating the power service whenever the screen changes to off (???)
[BetterBatteryStats] jago25_98:
I notice BBS comes out of the background, does something and then sleeps again. This is fine if I'm using the monitor widget but I'm not. I'd much prefer if it didn't do this. Is it essential to do this?

We need to update the wakelock reference wiki...
[BetterBatteryStats] alexinna:
Yes I did asked for this before. I think we would need to substruct phone time (when you talk) as well.

chamonix

Also regarding newly added %/h. Is it possible to get history per hour? For example if phone is idle and I would probably get less then 1% but if actively used number will be totally different. So in case I'm at work with minimum phone use but on a way home browsed internet and so on %/h will be shown in BBS with average value that is not that informative for me. I know you don't want to actively monitor but maybe it could be a user choice in a menu to wakeup ones an hour to calculate such info. Thanks.
[BetterBatteryStats] drahmed86:
+100 tha's the bottom line!!
[BetterBatteryStats] Lebenita:
Counting problems in 1.11RC6

In the RC6, I still see some funny numbers, see attached dump for an example. In particular:

Statistic Type: (5) Since Screen off
Since 23 m 59 s
...
Other Usage
===========
Deep Sleep (): 23 m 20 s (1400 s) Ratio: 97,3%
Awake (): 38 s (38 s) Ratio: 2,6%
...
Wakelocks
=========
SyncManagerHandleSyncAlarm (Android System): 3 m 23 s (203 s) Count:2 14,1%
...
CPU States
==========
100 MHz (): 8 s 0,6%
200 MHz (): 28 s 1,9%
300 MHz (): 7 s 0,5%
400 MHz (): 7 s 0,5%
500 MHz (): 9 s 0,6%
600 MHz (): 4 s 0,3%
700 MHz (): 4 s 0,3%
800 MHz (): 3 s 0,2%
900 MHz (): 1 s 0,1%
1 GHz (): 5 s 0,4%
1,1 GHz (): 0,0%
1,2 GHz (): 0,0%
1,3 GHz (): 0,0%
1,35 GHz (): 0,0%
Deep Sleep (): 23 m 20 s 94,4%

The problems demonstrated in this dump:

1. How can a single wakelock duration (SyncManagerHandleSyncAlarm) be significantly longer than the total wake time (203s vs 38s)? I'm having this problem quite frequently, sometimes with kernel wakelocks, sometimes with partial ones.

2. Why is the time you get by adding up all CPU times significantly longer (2.5% or 37s in this case) than the "Total time"? One result of this is that the deep sleep percentage is different in "Other" (97,7%) and in "CPU states" (94,4%) although the absolute time is reported as being the same (23:20).