yashsingh1/xdaforums huggingface dataset:
[BetterBatteryStats] TNSMANI:
This is supposed to have been fixed by last Monday. Read the OP's posts on the previous page.

That said if you can provide more information like your device, BBS version, Android version etc, it will help the OP in fixing it.

EDIT: The enable while charging option doesn't have anything to do with it.
[BetterBatteryStats] Tomo123:
ArrowOS 11 ( Android 11 ), BBS 469, all graphs work, besides charging one. Would've reported sooner, but damn, this battery LASTS :)
[BetterBatteryStats] TNSMANI:
Are you sure? Do GPS, wifi graphs work?

And your device please.
[BetterBatteryStats] curiousrom:
BBS Graph Bluetooth Missing 3.0-beta-2-469

@chamonix - As you can see in the attached BBS dump I used Bluetooth to listen to some music with my headset but it does not show in the graph panel.

Also the Charging graph does not make sense if you compare it to the correct Battery graph in the screenshot as I charged the device only at the end of the test.

That's on Galaxy S5 G900M LineageOS 18.1 klte build 2022-07-10 + Magisk 23.0 and BBS 3.0-beta-2-469: Statistic Type: Boot to Current.

I also attached a full logcat in case it may be useful.

BTW dmesg dump works. Thanks for fixing it.

***
[BetterBatteryStats] Tomo123:
Graphs work, except charging and, recently, Bluetooth ( same as curiousrom ).

Listened to some music over Bluetooth for around 5 min, Bluetooth stayed at 0.0%, no changes in graph.

Poco X3 Pro, ArrowOS 11, Magisk 25.1, BBS 469.

EDIT: Also added a screenshot from Gsam, since it seems that it recognizes Bluetooth being on ( while it hass issues with Wifi :) )
[BetterBatteryStats] shaggyskunk:
Yeah I'm not sure - But I THINK that the Stats While Charging - Might be to tell you how long until charged? There'd be no point that I can think of in seeing battery usage while charging?
[BetterBatteryStats] chamonix:
Anyone with a rooted android 13 who would be ready to run a test app? I have no progress ATM but see exactly where accessing the batterystats fail. It may be an issue with Google but I am usure since it is deep (reading cpu stats) in the calls tack from a file on /proc that I don't see on an unrooted device. The fact that google does not publish the current source for Beta doesn't make my life easier...
[BetterBatteryStats] wrongway213:
I'm ready. I'm running your latest beta on A13 Beta 4, Pixel 4 XL. It already pulls everything but Summary, it seems. I'd be glad to run some tests and send whatever logs or info you need.
[BetterBatteryStats] chamonix:
Thanks for the offer and also letting me know. Can you confirm that your device is rooted?
[BetterBatteryStats] wrongway213:
It absolutely is. Magisk 25.1.
[BetterBatteryStats] shaggyskunk:
So much for "open source".. 🙄

No Root here - But appreciate ALL of your Time & Efforts! 🙇🏼‍♂️🕊️
[BetterBatteryStats] chamonix:
A new build is on its way with an additional option "Diagnostics" under advanced settings. It shows the call-stack and status of the hidden api call (you can copy/paste the content from the screen).

Interestingly I rooted my p6xl this morning and it still fails the diagnostics with the error retrieving the CPU frequencies so I am really curious to see if there is a difference with other devices like the pixel 4.
[BetterBatteryStats] wrongway213:
This is what it returns on my Pixel 4 XL:

invoking android.os.ServiceManager.getService("batterystats")

android.os.ServiceManager.getService("batterystats") returned a service binder

invoking com.android.internal.app.IBatteryStats$Stub.asInterface

invoking getStatisticsStream

retrieving parcel

SUCCESS

I'd be glad to take any logs or additional info that would be helpful - just let me know if there's anything you need from me.
[BetterBatteryStats] beeshyams:
Pixel 4a output, Android 12.1

invoking android.os.ServiceManager.getService("batterystats")

android.os.ServiceManager.getService("batterystats") returned a service binder

invoking com.android.internal.app.IBatteryStats$Stub.asInterface

invoking getStatisticsStream

retrieving parcel

SUCCESS
[BetterBatteryStats] chamonix:
This is really interesting: my p6xl on beta 4 and rooted fails on "getStatisticsSteam". I will do some more digging into the obvious difference: the failure can me traced back to a null PowerProfile. I am not sure if this the real cause or just a side effect because that points to a bug in the p6xl stock implementation (the behaviour is identical without root)
[BetterBatteryStats] chamonix:
For the record this is what my p6xl says:

The checkNotNull is about the PowerProfile

Spoiler content hidden.
[BetterBatteryStats] chamonix:
Unfortunately it looks like you will have to send me your phone NOW! ;)
[BetterBatteryStats] wrongway213:
Send me your P6 and we have a deal 🤣
[BetterBatteryStats] Tomo123:
I am sure it's not needed, but here's a diagnostic from Android 11, ArrowOS, Poco X3 Pro. Just for $hits and giggles.
[BetterBatteryStats] chamonix:
I will add some core to the diagnostics to accommodate the fact that the method on one version expects a boolean an in the other not: that is the reason for the method not found exception since on your build the signature is different. You are all good though
[BetterBatteryStats] AmalVerghese:
Hello,

I know that it looks like there isn't much of a battery drain on this log, however, I do occasionally get some excessive battery drain while the phone is on idle. Just wanted to see if there is any unusual activity. I have attached the dump file to this post. Thanks.https://drive.google.com/file/d/1zo7X82uLf04tygW5g4_rMcVCpqF7sQi8/view?usp=drivesdk
[BetterBatteryStats] Tomo123:
Did a quick glance. Besides Wifi being on all the time, Google/Whatsapp/Snapchat doing their thing... to me, it seems in order. Having 0.7% overnight loss with Wifi on is completely OK in my book. Someone, feel free to correct me on the matter.
[BetterBatteryStats] chamonix:
New version with Android 13 support (unrooted) and better diganostics is building
[BetterBatteryStats] chamonix:
Long story short for the Android 13 issue on my p6xl.

For a bit now Android has introduced a PowerProfile that helps in calculating power consumption. When instanciating the batterystats object there seems to be a difference between p4xl and p6xl:

- on p4xl the PowerProfile is instanciated so creating the batterystats instance works as before

- on p6xl the method above fails because the PowerProfile is not set. I was able to work around that by creating the PowerProfile, passing it to the batterystats instance and then initializing it: WIN!

No idea why this difference and I don't believe it is on purpose. I have updated the diagnostics screen to show which method (above) fails so that we can track Google fixing this bug.
[BetterBatteryStats] Tomo123:
Bad luck you ain't working on a cure for cancer, because you would eradicate it a long time ago :) Latest 479, for info:

Build.VERSION.RELEASE: 11

Build.BRAND: POCO

Build.DEVICE: vayu

Build.MANUFACTURERXiaomi

Build.MODEL: M2102J20SI

Build.VERSION.SDK_INT: 30

invoking android.os.ServiceManager.getService("batterystats")

android.os.ServiceManager.getService("batterystats") returned a service binder

invoking com.android.internal.app.IBatteryStats$Stub.asInterface

FAILURE: an exception occured

STACK TRACE

java.lang.NoSuchMethodException: com.android.internal.app.IBatteryStats.getStatisticsStream [boolean]

at java.lang.Class.getMethod(Class.java:2072)

at java.lang.Class.getMethod(Class.java:1693)

at com.asksven.betterbatterystats.DiagnosticsActivity.diagGetService(DiagnosticsActivity.java:180)

at com.asksven.betterbatterystats.DiagnosticsActivity.onResume(DiagnosticsActivity.java:94)

at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1456)

at android.app.Activity.performResume(Activity.java:8129)

at android.app.ActivityThread.performResumeActivity(ActivityThread.java:4428)

at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:4470)

at android.app.servertransaction.ResumeActivityItem.execute(ResumeActivityItem.java:52)

at android.app.servertransaction.TransactionExecutor.executeLifecycleState(TransactionExecutor.java:176)

at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:97)

at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2066)

at android.os.Handler.dispatchMessage(Handler.java:106)

at android.os.Looper.loop(Looper.java:223)

at android.app.ActivityThread.main(ActivityThread.java:7665)

at java.lang.reflect.Method.invoke(Native Method)

at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:594)

at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)
[BetterBatteryStats] One Twelve:
Which version of One UI are you on ? 4.0 or 4.1

Your Galaxy S10 populates the CPU states section of the BBS log just fine.

I cannot get my S20FE to do it. You are using 440. I'm on 469

Do you have always on display on ? try with it disabled

Do you have edge lighting enabled ? try with it disabled

Is your GPS on ?

Turn mobile data off, it seems the phone switched to it when Wifi was down momentarily

To get a baseline as in the minimum your phone will draw. Run a log in airplane mode.
[BetterBatteryStats] shaggyskunk:
@chamonix - Thanks for the update to BBS 🙇🏼‍♂️ 🕊️
[BetterBatteryStats] chamonix:
Could you please retry Diags with the latest build? It should appear nicer and with more info about it succeeding
[BetterBatteryStats] Tomo123:
You may call me crazy, but these small things bring tears of joy to the eye:

Build.VERSION.RELEASE: 11

Build.BRAND: POCO

Build.DEVICE: vayu

Build.MANUFACTURERXiaomi

Build.MODEL: M2102J20SI

Build.VERSION.SDK_INT: 30

invoking android.os.ServiceManager.getService("batterystats")

android.os.ServiceManager.getService("batterystats") returned a service binder

invoking com.android.internal.app.IBatteryStats$Stub.asInterface

resolving getStatisticsStream(boolean)

FAILED

falling back to getStatisticsStream()

invoking getStatisticsStream

retrieving parcel

SUCCESS

Thank you.
[BetterBatteryStats] Wolfcity:
@chamonix: Thanks for the load of updates coming in over App Center! Fixed a lot of small issues on my Xiaomi Mi 9T running Android 11.

Keep up your good work.👍
[BetterBatteryStats] PeQuEsan:
I just want to say a big thank you to @chamonix. Last BBS version is working perfect under Android 13 (current beta 4). :)
[BetterBatteryStats] bobdowl:
Hello my friends.

I'm having some heavy wakelock issues and can't pinpoint the issue.

Log: https://pastebin.com/Vejc75X8

(Created as per the guidelines from OP)

Some more info:

It started when I switched to a new ROM (clean install, everything wiped, no backup files used at all).

I reset everything once more after two weeks but the issue persists

It drains up to 20% over night when Mobile and Wifi are enabled (disabling only one of them doesn't help)

If I run Airplane mode, the wakelocks stop.

I tried disabling multiple apps / google services to see if it gets better but it didn't help.

Your help is extremely appreciated.

PS: The dump from this night only shows 1,1%/hr loss which is extremely unusual, however if you look at the stats, the wakelocks are still present and my device is constantly waking up.
[BetterBatteryStats] TNSMANI:
Your mobile signal is 'good' not 'great'. Mobile signal is one of the major drainers in any device.. 'Good' is ok but 'great' would be, ummm, great.

Photos app was holding wakelocks for sometime and seems to be running for more than one hour. You also have some video compression going on in the background, whatever that is.

I don't know why this was happening:

Any ideas?

And then this:

Some kind of instant messaging service? This was struggling to keep a connection.

The above two would normally indicate mobile/wifi signal issues, in my opinion. But you don't seem to have a patchy signal.

Duolingo and Photos had some background uploads/downloads which should be normal.

The pickup sensor was awake for more than 6 hours. I don't know how much battery it would consume but why don't you disable the pickup function when you next take an idle dump file?

This is all I can see. By the way, how old is the battery?
[BetterBatteryStats] bobdowl:
Thanks so much for the reply!

So I think we can exclude the mobile signal, as I haven't moved locations in a while and it wasn't a major sore spot in my previous Installation.

The video compression thing is weird, I have absolutely no idea what that could be.

The microG thing is part of YouTube Vanced, I also saw this as a potential issue, but upon completely uninstalling the app my drainage and the wakelock graph didn't look any different.

I also previously disabled the pickup function as I thought that might lead to some issues, however disabling that also didn't seem to help at all.

The instant messaging service should be WhatsApp (unfortunately in my area you need it to be able to socialize)

Still, I'll adhere to your suggestions, uninstall all apps and services that seem to be an issue and post a new log tomorrow (I'll let it run during night time).

Ty!

Edit: Forgot to mention, battery is about 2,5 years old, but it always held up nicely.

I could do 6 hours SoT (until June, old ROM) on average and with my usage I could go for up to 2 days, given that my device is able to save lots of power when unattended.
[BetterBatteryStats] TNSMANI:
If things don't improve, you may have to go for another ROM or battery.
[BetterBatteryStats] One Twelve:
If you shot any video then photos would be recompressed for upload. The thing is I don't see much network traffic so nothing got uploaded back.

The accelerometer sensor is being held by the trello app for some reason. Any setting in that app that might be responsible.

Vanced caused the most alarms. Is there any way not to optimise the microg app ?

Your phone did not switch to mobile and remained on wifi throughout. But the 'No data connection' entry is still there under the header 'Other Usage' suggesting some attempted switching is happening.

There is a setting in the developer options that disables switching to mobile if wifi goes down. Check if that is set.

Try a battery baseline test. Charge to full. Then power the phone off. After 8 hours, power it on and see how much drained.
[BetterBatteryStats] Nastrahl:
Vanced micro G had some insane default setup that may be the cause.

You can also go in the apps list and disable doze and its notification altogether or it would complain about battery optimization.
[BetterBatteryStats] Nastrahl:
Some apps like WhatsApp rely on sensors to bypass doze/battery optimisation. I don't know how to prevent that.
[BetterBatteryStats] Tomo123:
I disabled cloud messaging and device registration completely. Not a peep from microG, as it should be, since I use it only as a login tool for Re/Vanced Youtube.

Disable sensors permission in the permission page?
[BetterBatteryStats] Nastrahl:
I can't find it.

I only got two permissions listed that could be tied to sensors : physical activity and body sensor but micro G is on neither.
[BetterBatteryStats] bobdowl:
Weird, I haven't even logged into Trello after the last system wipe.

I restricted microG further to see how it behaves.

Regarding the mobile data switch - from a settings perspective it was the other way around.

"Keep mobile data always active" was checked by default, I disabled it for now.

I'll create a new dump over the weekend, including the battery baseline test.

For now, it already seems to behave better.

During 8 hours of sleep, my phone consistently drained 9% battery for the last three days, which is pretty good.

Thanks I had the notification disabled already, I further restricted the app.
[BetterBatteryStats] Nastrahl:
I don't have that choice unfortunately
[BetterBatteryStats] Tomo123:
You could try to reinstall latest version of Vanced's MicroG, maybe... I have Sensors enabled, but looking at BetterBatteryStats, it does not use them one bit.
[BetterBatteryStats] shadowdevil:
Thank you for the update !
[BetterBatteryStats] noobSU:
@chamonix @TNSMANI All permissions given. Version 3.0-beta-3-482. Still kernel wakelocks & partial wakelocks are not showing. Everything else is oki. Can you pls help?

A12L/Ricedroid/BBS Version 3.0-beta-3-482

Edit: After reboot, Partial wakelocks are showing data but kernel wakelocks still empty.
[BetterBatteryStats] TNSMANI:
I have no idea. Please wait for the dev or any one more knowledgeable to reply.
[BetterBatteryStats] loveleeyoungae:
In the Kernel Wakelock page, there is this description "Cnt:(c/wc/ec)34/0/0" etc.

"Cnt" is "Count", so what are "wc" and "ec" stand for?
[BetterBatteryStats] Oswald Boelcke:
Please see this post by @DB126
[BetterBatteryStats] chamonix:
3.0-485 is up with a few language fixes. This release is also going to public beta on google play (staged to 10% for now). Depending on google (they had removed the app for dubious reasons) and on feedback you can expect a 3.0 release back on gplay soon
[BetterBatteryStats] Tagion:
Can someone help me find out what's keeping my device (Pixel 6) awake?
[BetterBatteryStats] xn0live:
Hi can anyone explained what that for alarm is, and can i reduce it?l or is ot normal?

___

android (): Wakeups: 873 (2.4 / min)

Alarms: 611, Intent: WifiConnectivityManager Schedule Periodic Scan Timer

Alarms: 194, Intent: *job.deadline*
[BetterBatteryStats] TNSMANI:
This is an in-use dump. Not an idle dump. Plus the dump is only for 3+ hours as against the requirement of a minimum of 6 hours. Please read the first three posts of this thread and attach a proper dump.
[BetterBatteryStats] TNSMANI:
No, this is not normal if it is an idle dump.

This means that pending jobs are getting postponed due to the phone being asleep.

That said, this is no way to assess the drain. As I said in the above post, please read the first three posts of this thread and attach a full idle dump file. Piecemeal analysis will result in more harm than good.
[BetterBatteryStats] officiallyme:
Hey everyone

I would like to track down whatever app is causing my Android TV to wake up from deep sleep.

I installed the latest xdaedition but it does not seem to properly log (only kernel wakelocks and partial wakelocks). And it does not show the actual app name (e.g. com.android.gms).

Is there a special version (or an alternative) for Android TVs?

Cheers

Alex
[BetterBatteryStats] TNSMANI:
I am curious. Why are you worried about a TV which runs on mains power, waking up?

AFAIK, there is no separate BBS version for TVs. You may try some older versions of BBS which may work.
[BetterBatteryStats] officiallyme:
Well, a modern TV should consume ~ 1 W in standby. Due to the constant wake-ups the TV consumes ~ 25 W, which is just wasteful.

So if I can track down the culprit, I can uninstall whatever Android OS nonsense is keeping the TV alive.
[BetterBatteryStats] DiamondJohn:
Have you gone down the easiest path first, and checked in the standard battery settings for which app is consuming the power? if it is an app and not "the system". Have you checked the history of doze the device went through?
[BetterBatteryStats] officiallyme:
Android TV OS does not show battery info (probably since it does not have a battery ;-) )
[BetterBatteryStats] TNSMANI:
There you have it. Since battery info is absent in the OS, BBS doesn't show the full stats.
[BetterBatteryStats] DiamondJohn:
Ha! dont you love it when someone answers their own question.

And you did not answer the other question, which most definitely exists regardless of battery existence. If your device is missing a working doze, then you may have another answer.
[BetterBatteryStats] officiallyme:
But bettery battery stats just monitors all activity, does it not? I am also not sure if the funtionality of battery monitoring is missing from the OS or if it is simply not included in the UI.

I need to check what "history of doze" is and where I can find the information. UI of Android OS is limited.
[BetterBatteryStats] DiamondJohn:
Doze was a HUGE addition to Android, one of those big Google projects that even got is own project name. Came out with marshmallow.

I have created an app for rooted users that display the doze history graphically.

https://xdaforums.com/t/app-2-2-05-oct-v2-4-betterbatterystats.1179809/post-86524893
[BetterBatteryStats] Top7u:
Hi everyone!

Please help to determine why it takes about 2.5%/hour when the phone is not in use. Huge battery drain.

The phone OnePlus 9RT, new, was bought 2 weeks ago. Firmware is the latest Oxygen OS 12 (updated via OTA). Disabled some unnecessary apps. Disabled AOD, Ok Google, turned off double-tap to wake and raise to wake the screen. 1 SIM card in 3G/2G mode. At the time of measurement (at night) turned off Wi-Fi and location.

Maybe someone knows if "NetworkHealthService" and "com.oplus.deepthinker.Intelligent Services" these sensors are ok? Their time is 100% of the measurement time. Also, "Google Play services" with sns_smd and pedometer took a lot of time.

Spoiler content hidden.

UPD.: I turned off everything related to step tracking (Google Fit, etc.) and uninstalled NetworkHealthService (some app from OnePlus) and com.oplus.deepthinker using ADB, however, I also switched the mobile network to 2G. During the night it became 2%/10 hours . I will switch some of that back on, starting with the network mode, but that's definitely much better.

And what is "elevator_detect" sensor anyway? It's some proprietary thing from OnePlus (or BBK in general), something network related. But I didn't find any information on the internet.
[BetterBatteryStats] customuzer:
@chamonix i still can't find BBS in the Playstore. Do everyone can see it in the Playstore or just the beta users, who subscribed before disappearing from the store?
[BetterBatteryStats] Lughnasadh:
Please read the OP, particularly Post #2.
[BetterBatteryStats] shaggyskunk:
Think that only the xda version is updated - So why would anyone want any other version?
[BetterBatteryStats] customuzer:
He himself said, that he will upload it to the Playstore therefore I'm asking.
[BetterBatteryStats] shaggyskunk:
I must have missed chamonix's post saying that..
[BetterBatteryStats] Lughnasadh:
If/when Google accepts it I'm sure he'll announce it.
[BetterBatteryStats] DiamondJohn:
It occurred to me you are screwed multiple ways.

For starters, this thread is OT for you, as the instructions in the first post say to take a log while the phone is unplugged. You cannot satisfy the requirement.

Secondly, most manufacturers have to worry about battery drain, these guys could easily take a short cuts and just say "its a battery that never discharges and is always [plugged in, charging"

Thridley, when my phone is plugged in, itr doze not go into doze, which means it would never reach a low power state.

I cant remember if you every told us. Are you rooted?

The next thing I would try is trhe battery history report. A text based report with near endless info, and not just regarding the battery charge. From that, you can get endless amount of wake lock and wake up app etc etc etc details. See the following post

https://xdaforums.com/t/app-tool-temefi-comprehensive-system-administration.3806260/post-85153055

That app also has graphs sowing your doze history.
[BetterBatteryStats] chamonix:
I have appealed google's removal and my appeal was accepted. I was able to create a new public beta and started with 10% of subscribers for the previous beta and will increase to 100%. If you were a previous beta subscriber you should see it pretty soon, if not it's just a matter of days as long as I don't get removed again ;)
[BetterBatteryStats] chamonix:
In gplay you can buy me a beer ;)
[BetterBatteryStats] shaggyskunk:
Don't see it yet on the Play Store?
[BetterBatteryStats] chamonix:
It'a just a matter of time since I am still staging-up the beta ring.
[BetterBatteryStats] shaggyskunk:
The private api is new on the xda_edition?

Tried running the adb command a couple of times - But still requesting it.. 🤔
[BetterBatteryStats] amn1987:
BBS isn't compatible with A12? The last 2 versions don't work. Blank screen after installation.
[BetterBatteryStats] shaggyskunk:
Android 12 / One UI V4.1 Samsung Galaxy S20 Ultra Snapdragon variant.