yashsingh1/xdaforums huggingface dataset:
[BetterBatteryStats] x.danik:
Nougat support?

I cant get the app working on Nexus 6P running latest Nougat (N2G47H)... Is this app compatible with Nougat yet?

I cant get any data into the app - everything says "No stats have been collected yet".

In logcat:

04-30 13:16:44.413 15072 16245 E BatteryStatsProxy: An exception occured in BatteryStatsProxy(). Message: Transaction failed on small parcel; remote process probably died
04-30 13:16:44.413 15072 16245 D BatteryStatsProxy: getWakelockStats was called with params [iStatType] = 1
04-30 13:16:44.414 15072 16245 E StatsProvider: An exception occured processing kernel wakelocks. Message: null
04-30 13:16:44.415 15072 16245 E StatsProvider: Exception: com.asksven.android.common.privateapiproxies.BatteryInfoUnavailableException
04-30 13:16:44.415 15072 16245 E StatsProvider: at com.asksven.android.common.privateapiproxies.BatteryStatsProxy.computeBatteryRealtime(BatteryStatsProxy.java:312)
04-30 13:16:44.415 15072 16245 E StatsProvider: at com.asksven.android.common.privateapiproxies.BatteryStatsProxy.getKernelWakelockStats(BatteryStatsProxy.java:2298)
04-30 13:16:44.415 15072 16245 E StatsProvider: at com.asksven.betterbatterystats.data.StatsProvider.getCurrentKernelWakelockStatList(StatsProvider.java:1231)
04-30 13:16:44.415 15072 16245 E StatsProvider: at com.asksven.betterbatterystats.data.StatsProvider.populateReference(StatsProvider.java:2802)
04-30 13:16:44.415 15072 16245 E StatsProvider: at com.asksven.betterbatterystats.data.StatsProvider.setCurrentReference(StatsProvider.java:2671)
04-30 13:16:44.415 15072 16245 E StatsProvider: at com.asksven.betterbatterystats.StatsActivity$LoadStatData.doInBackground(StatsActivity.java:874)
04-30 13:16:44.415 15072 16245 E StatsProvider: at com.asksven.betterbatterystats.StatsActivity$LoadStatData.doInBackground(StatsActivity.java:1)
04-30 13:16:44.415 15072 16245 E StatsProvider: at android.os.AsyncTask$2.call(AsyncTask.java:305)
04-30 13:16:44.415 15072 16245 E StatsProvider: at java.util.concurrent.FutureTask.run(FutureTask.java:237)
04-30 13:16:44.415 15072 16245 E StatsProvider: at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:243)
04-30 13:16:44.415 15072 16245 E StatsProvider: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
04-30 13:16:44.415 15072 16245 E StatsProvider: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
04-30 13:16:44.415 15072 16245 E StatsProvider: at java.lang.Thread.run(Thread.java:761)
04-30 13:16:44.421 15072 16245 E StatsProvider: An exception occured processing battery realtime. Message: null

I have tried:

1) Installing as normal user, granting superuser and adding premission through ADB

2) Instaling as systemapp using Magisk AppStemizer (I cant touch the SYSTEM partition - Google Pay)

3) Combination of the step 1) and 2)...

I am rooted with Magisk, running FC kernel, stock OS.

App version - BetterBatteryStats_xdaedition_2.2.2.0.apk

Any ideas please? Iam trying for hours...
[BetterBatteryStats] DB126:
Thinking Magisk may be the problem. Seem to recall some past dialog to that effect. Do a keyword search of the BBS threads. Good luck.
[BetterBatteryStats] githyanki:
All I had to do was install and grant permission from magisk. Using adb is not necessary, and may be what messed things up.
[BetterBatteryStats] x.danik:
Ok, I have uninstalled and reinstalled the app and grant it root permission from magisk - i can see Kernel Wakelock and CPU states but everything other is still unavailable...

Magisk is NEED now days, so there is no chance i trade working Magisk root with working Google Pay for working battery stats and IMHO Magisk is not the source of the problem...

Any other ideas please?
[BetterBatteryStats] chamonix:
If you are ready to accept things being broken at times, are ready to spend to effort of reporting errors and want to be on the bleeding edge you can go visit HockeyApp to download the xda edition:

- a new build will be created whenever I commit

- you will get auto-update support

- you accept usage and crash data to be collected (opt-out possible but that would make me sad)

- 100 slots available for now, this is an experiment...

Go here to apply.... and of course tell me what you think!
[BetterBatteryStats] phonetech101:
Here my first dump file, please can someone tell me if all looks right if not where can I improve, thanks guys.
[BetterBatteryStats] justjr:
Your device slept all the time, no awakes, 0,4%/h is pretty good. I would be satisfied.
[BetterBatteryStats] phonetech101:
Awesome thanks, yip very happy. A lot of trail n error but it paid off ?
[BetterBatteryStats] DB126:
Perhaps not; I did not find the reference mentioned in my earlier post. Also saw another contributor is using BBS sucessfully with Magisk. Great! That said, the developer posted to this thread immediately surrounding the Magisk discussion and had no comment. Apparently the answer is not definative.
[BetterBatteryStats] githyanki:
I use magisk and all stats show up fine. You may need to charge it once to get it started, but really for me it just worked, no fussing around.
[BetterBatteryStats] Clandaries:
Here is how it looks on my Galaxy S8. No much info on the screen but i think the values are shown are ok.

My Galaxy S8 can run 2 days without charge. i think this is really good.

But i think we need an update or i need root... But root is not an option at the moment, dont want to losse my data...

Greetings
[BetterBatteryStats] chamonix:
The reason I did not comment is that I have no specific knowledge of the tidbits of using magisk. What I can say is that BBS has no dependency to any tool and does not require root to work, it only requires specific permissions that can be granted by:

- using ADB as described in the FAQ

- letting the app grant itself the permission if root is available

When diagnosing / analysing there are a few important things to know:

- the app (advanced settings) shows you whether the permissions were granted or not

- when checking if any acition had a positive result you should always use raw stats as the default view does a diff between two snapshots, i.e. if one snapshot is missing it may show no results

- logcat may give you some info about what is going wrong, e.g. the app not being able to contact the battery_info service
[BetterBatteryStats] Estebanium:
Hey guys, I am unable to get it working. I am on SuperMan V2.5.0 (Nougat) with Magisk 12 and installing it via Google Play or as System App will not show any stats. There is just this warning here in yellow and that it could load "from" "to" (don't know what it is called in English, being on German).

Do I have to fully charge my phone maybe? Just charging it to 80 %.. I am out of ideas :rolleyes:

edit:

BATTERY_STATS AVAILABLE

DUMP AVAILABLE

SE_LINUX
[BetterBatteryStats] DB126:
Exactly what I was looking for. Seem to recall a similar post/comment in the recent past but couldn't find it. So this one becomes the reference for those seeking similar guidance downstream. Or possibly a notation in the OP/FAQ.
[BetterBatteryStats] Oswald Boelcke:
Using BBS on Resurrection Remix-N-v5.8.3 with Magisk v12: No issues at all!
[BetterBatteryStats] chamonix:
Updated, and I took the opportunity to re-visit/update a few other FAQs
[BetterBatteryStats] chamonix:
Check the raw stats. If these work just plug/unplug and leave your phone alone for a while, stats will finally start to show
[BetterBatteryStats] Estebanium:
Thank you for your reply. I checked the raw stats and a message popped up that said "BatteryInfo service is not available." So this is maybe the reason for my issue, but how can I solve this?

LOL?! 15 Minutes later it is working... Was it necessary to open raw data? So now, after it is working. Is it still recommended to move this app to system on nougat?
[BetterBatteryStats] chamonix:
No the problem is not related to opening the raw stats, it's probably this issue: https://github.com/asksven/BetterBatteryStats/issues/790 (working on it).

And no, the use of the system-app is deprecated as not required anymore.
[BetterBatteryStats] chamonix:
[MENTION=6867525]Estebanium[/MENTION] : I just committed an attempt to fix in build #91 (still building). Please check post #31976 if you want to give it a try.
[BetterBatteryStats] chamonix:
Me neither so another wild guess: can you and have you tried to turn off fast dormancy? Should not be related but who knows what the ril does when that option is unsupported by your network
[BetterBatteryStats] ithehappy:
OK, thanks for clarifying. And the wording is appropriate I guess ;)

Regards.
[BetterBatteryStats] carlos67:
The BLN hacking you mention excites me. Are you thinking along the lines of further customization with the blinking lights. For example, blinking left light only = missed call, blinking right light = missed sms, both blinking together = ??whatever??

Thats what I think BLN needs to move towards. However, it may not be possible to blink the lights separately. Maybe it's both together or none at all??

btw....did you know that tasker has a plugin for BLN?? I guess you did.

Looking forward to whatever you create next.
[BetterBatteryStats] nobnut:
I believe it was Albert Einstein who once said "Intellectuals solve problems; geniuses prevent them".

;)
[BetterBatteryStats] nobnut:
Just a follow up on the previous posts about location based wakes. If you think about it, a number of apps draw on Google location services to obtain location information. Some of these are obvious and include weather widgets, train timetables etc others are less obvious, sometimes being things that you wouldn't associate with needing a location.

If you are not signed in to Latitude but you are getting lots of location based wakes... have a look at what you have installed.

A hypothetical example... your weather clock widget is set to update every 15 minutes... where do you think it gets your location information from? (Here's a clue, it isn't iOS... it is Google/Android's location services)

#justsayin ;)
[BetterBatteryStats] chamonix:
Well I have to use what the kernel provides me and right now it's both LEDs or I still have missed something. But the way (speed, interval) they blink is java code so that I can work on :)

Anyway it's just writing to files so it's not that complicated. The interesting part is getting the broadcasts from other apps/services. I spend 4 hours to find out that gosms is coded in such a bad style that they a) cancel the broadcast by aborting the propagation of them and b) use a priority that is way out of line and does not comply with dev guidelines. The app is cool but that's bad bad style. Anyway I'll release till the weekend but don't expect anything fancy yet.
[BetterBatteryStats] chamonix:
Well from the sdk and good samples there is a way to circumvent that by applying larger ranges to the position changes an app is interested in. By doing so you can get a callback only when you have moved eg 10 Km. This would at least save some juice. What I don't know is how much it impact the activity of the notification service but I'm going to find out. I have registered all the apis and have just to have a look at oauth to be all set to start. So that makes three project now :)

I will release a candidate for 1.0 next week as well as I feel it's ready for distribution now (with the graph bars) as soon as I have fixed the names of the upper combo. I almost forgot how much fun coding was...
[BetterBatteryStats] Neo3D:
Great app! But, is there a guide for the noobs on how to use all that data?

My phone is able to go into DEEP SLEEP, however, I still see apps showing up under WAKELOCKS, so I'm not sure what that data means because my phone deep sleeps just fine?
[BetterBatteryStats] betaelmer:
I need to help to determine my Samsung Galaxy S 2 battery usage. Today, I only use the phone for 3 hours and battery drop 22%. By using BetterBatteryStats Wakelocks since charged, I notice StartingAlertService keep my phone awake 30% of the time. I knew won't see this service if I leave my calender empty but that's kind of defeat the purpose of using a smartphone. I tried play around with calendar's notification setting with no help.

Any suggestion on how I can minimize this 'StartingAlertService' of keeping my phone awake?
[BetterBatteryStats] chamonix:
Wakelocks do not prevent deep sleep they wake your device and keep it awake. If you consider deep sleep as an optimum WL are the potential to be optimized
[BetterBatteryStats] chamonix:
I see you started a thread so you will be able to report here ;-)

More seriously you will find all details here: http://hi-android.info/src/com/android/calendar/AlertReceiver.java.html

Google is your friend

More seriously again read the code. To me it is self speaking, if you have questions just ask after studying it
[BetterBatteryStats] nobnut:
Do you have any/many reminders or alarms set? Or do you use the 'snooze' function often? This page would appear to suggest that this might be the cause.

Also, you could stop your blouetooth share service when you are not using it. That kept your device awake for a long time also. It was the second most prevalent wake cause in your list.
[BetterBatteryStats] betaelmer:
Thanks for the suggestion. For my calender, I do have several meeting scheduled with alarm set (which is by default on any of my meeting from my work). I don't use any snooze feature. But I have already tried turn off notification completely or only have status bar notification.

For the bluetooth, it's because of my honda odyssey bluetooth handfree feature and I suspect it's related to the phone book autosync feature. I have turn off the sync feature from my car and see whether I can improve the bluetooth keeping my phone awake.
[BetterBatteryStats] carlos67:
WHAT IS IT WITH THIS DAMM PHONE!

Ok, I'm calm (ish) - for hours it's been sleeping and current drain was high anywhere between 18~220mA:eek: (see attached pic)

However, i do a simple reboot and let it sleep for half an hour and then check the drain and what do I find?

1mA since it was put to sleep. Guys, this raises a question.

Why, after a simple reboot is all the drain gone? I mean before rebooting there were no apps running because I had cleared RAM memory hours earlier in task manager and checked the apps running tab and it said no apps running. (btw I don't trust what task manager reports as running because when it says 0 apps running, I am sure there are apps running somewhere)

I am confused. Maybe I should do a tasker profile that reboots every 2 hours or so? Maybe that's the only way to keep the current drain under 10mA?
[BetterBatteryStats] nobnut:
This does happen from time to time but the solution does not lie in rebooting to resolve the issue. All that will achieve is to mask the problem. What I would do is to find out what is causing the higher drain and address that problem. In other words tackle the problem and not work around it.

When you have identified that the phone is drawing more power than normal, run BBS to see what has been running or causing wake. Then remove the app concerned, or adjust its settings.

Killing tasks or clearing RAM is never an answer. When you have finished using an app, exit it properly. If you find things running on your device when you do not want or use them, either uninstall them, or prevent them from starting in the first place. To kill them will use more power as they will in 99 times out of 100, just restart.

To prevent them starting, use either Autostarts, or Gemini App Manager (excellent app).

Just one example of an app that starts for no good reason is BBC iPlayer. It just never turns off. So, if you want it, prevent it from starting automatically. Simple.
[BetterBatteryStats] Mikulec:
Just my 2 cents:

Reboot also resets runnig proccesses, not only running apps. If u clear your ram it does not affect some of the running proccesses in the background.
[BetterBatteryStats] carlos67:
Thanks guy's. Agree with everything said. The problem I seem to have is that my wakelocks are small time wise (and hence % wise) but very high in number/occurences. For instance, I may have a wakelock of only 0.3% which seems nothing, however, the count on that same wakelock will be 600 or so. Sometimes even higher maybe 2000 occurences. This says to me that the app/process concerned is issuing multiple wakelocks very very quickly. Otherwise, how can the wakelock count be so high, yet the wakelock time seem relatively trivial?

I would love to know the actual mechanism that's taking place that gives this result.

Will post some pic's shortly of my wakelock stats so Nobnut can cast his expert eye over them. :)

Thanks again for the replies.
[BetterBatteryStats] wintermute000:
CAn I run this together with watchdog or do they interfere?
[BetterBatteryStats] LuffyPSP:
Guys, i turned my sync off, but i got a message saying whatsapp doing full sync. Then another one, i didnt use fb official app. Only signed in and disable sync and disable notification too. Why they happen to be awake? Before this it didn't have this problem with same setting. Any clue why?

Nuked from Samsung Galaxy S2 GT i9100 using XDA Premium app
[BetterBatteryStats] Irish Whiskey:
In one of the next versions. Would there be a way to click on a wakelock to find out what it is for.
[BetterBatteryStats] M@31:
Alright, thanks again for the help.

Have attached some screen shots and batterstats file.

Im trying to find an app that will let me dump dmesg, so far, no luck.

Ill keep trying this morning.

Also, I know the basic controls for adb, and have everything installed.

I will try to get that running as well.

Thanks again!
[BetterBatteryStats] M@31:
Wow, kakaotalk really wakes my phone up 146 times throughout the night??

crazy!

whats the new svnet that has come to the top of the wakelocks now?
[BetterBatteryStats] jeremysherriff:
An app that dumps dmesg is "Android Terminal" ;)

su
dmesg > /sdcard/dmesg.log

or adb:

adb shell
dmesg > /sdcard/dmesg.log
[BetterBatteryStats] M@31:
Thanks again for the help!

Think I gots it figured out
[BetterBatteryStats] M@31:
You guys are amazing!!

Cant press the thank you button enough!
[BetterBatteryStats] longfeng:
I have installed over 20 cROMs in the phone and in some cROMs, some non-sys apps are made sys apps thereby drawing more battery consumption than others. Perhaps kernel and voltage do not affect wake up but they do affect battery life, which is our primary concern.

---------- Post added at 11:16 AM ---------- Previous post was at 11:12 AM ----------

How is the battery consumption? I believe it should be better with wifi off.
[BetterBatteryStats] M@31:
It was right around the same actually....about 15% for around 8,9 hours just sitting idle with the screen off.

Doesn't seem to be deep sleeping as much as it should...only about 93% last night...

I think it might be Kakaotalk or my Kernel.

I might switch back to the last version of the cROM and Kernel that I use.
[BetterBatteryStats] shinew:
I don't know, looking at your last BBS dump with gmail, gallery, calendar sync on and kaokao talk, 6% awake time seems entirely reasonable to me. how much lower are you expecting and where have you seen it in a comparable setup and identical phone?
[BetterBatteryStats] M@31:
Gallery and calendar sync?

Those should not be running, why in the world would gallery be running? How can it "run" as you say....? Same with calendar....how can these things "run"? Once they are closed, they are closed no?

Ive got it set up so that only kakao talk and gmail should be checking.....

(on a side note, what app should I use for gmail? I am using the the stock one now, and i have heard that 3rd party apps do not work now for gmail...is this true?)
[BetterBatteryStats] jeremysherriff:
The stock gmail app is the best for battery by far.

The calendar and gallery run in the background, it's no big deal and can be ignored. There's quite a few things that run as background services, unless your rom is completely screwy or you've put in some weird app that calls these somehow,these won't be an issue. As @shinew said, your battery drain looks pretty good and I doubt you'll get it better without removing kakao.

If you want proof, let your family know you'll be "offline" for a night (idle time) and disable kakao - see what the battery drain is like with it off.
[BetterBatteryStats] M@31:
I don't think I can actually "turn off" Kakao talk....without deleting the app that is.

It is a push service, so not too sure why it would be connecting so often, when I am not getting any messages.

There is no option to turn off connection, because it shows it as a push service.

It is supposed to close down once you close the app....
[BetterBatteryStats] longfeng:
I agree if the auto sync is not so frequent.

---------- Post added at 12:18 AM ---------- Previous post was at 12:11 AM ----------

I wonder if you will consider ebuddy instead of kaokao.

ebuddy is using google c2dm (push) for battery efficiency. I am not sure if Kaokao is adopting.
[BetterBatteryStats] shinew:
None of them are "running", they just have their syncs "on". I have most of mine on as well since I need them, but you can go into settings->account & sync -> your gmail account and uncheck whichever ones you don't need. It's not going to help much but if you want to squeeze the last ounce of juice, everything helps a bit I guess.

I still think there is nothing wrong with your wakelock If you need kaokao talk, I would leave just leave it there. Think of it this way, you got a smart phone there and 6% of the time when you're not using it, it's doing something for you that you need. if it doesn't do anything(0% wakelock), how could it be smart? :D
[BetterBatteryStats] SkoreK89:
Hi, i have a question. Why the running time of apps are diferent?
[BetterBatteryStats] shinew:
chamonix,

Just want to report back about my finding and I've attached the BBS dump from last night with WifiOn, 1 text message, 1 tasker action, 1 google voice message & 4 email download. Minus the screen on time, I get 10% awake time.

"sec-battery-adc": after some experiments, my best guess is that it is shown as the result of majority if not all the other wakelocks in some custom ROM. So it overlaps but not add to other wakelocks, IMO it can be ignored.

"wlan_rx_wake": Using Wireshark(thanks for letting me know about it), for me at least it's caused by excessive Arp broadcast from my router. After modifying some network settings, it has reduced by 4-5 times from 5%-7% wakelock time to 1%-1.5%, i might be able to improve it further if I dig into it more, but it's acceptable as is.

Overall I've reduced my wakelock time from 35%+ to ~10%, so I'll consider my issues resolved. Thanks for the great app again, w/o it, it would've taken me alot longer to sort this out!

p.s. one question I just thought about, would you mind explaining how the "Awake" under "other usage" is calculated/reported?

p.p.s one suggestion I have for the app is to either automatically put the dump file in a folder instead of the root of SD card or let the user select a folder to store them. For users(me :D) who generate more than 1-2 dump files for comparison, this could help organizing the dump files better.
[BetterBatteryStats] xuxuzao:
tks for 1.6

trying it now!!
[BetterBatteryStats] JerleMinara:
So I'm trying to puzzle out what kept my phone awake for the last two hours after I took it off charge to test battery life. Burned 7% battery life with screen fof doing nothing.

Running AOKP w/ Franco Kernel on an LTE GNex
[BetterBatteryStats] jeremysherriff:
Post dump files not screen shots: Menu->More->Dump to file

There's also a good tutorial article about battery drop after you unplug, you need to read, i'll post it here asap when I find the link.
[BetterBatteryStats] chamonix:
Are you using sdmail pro?