yashsingh1/xdaforums huggingface dataset:
[BetterBatteryStats] amn1987:
I had frozen the Magisk Manager app (necessary to bypass root detection in case of a few banking apps) earlier and after defrosting it of course BBS worked without any issues.
[BetterBatteryStats] Noob9496:
Anyone can help me with reducing this wakelocks? Oneplus 8 pro oos 11, blu_spark r130 kernel.
[BetterBatteryStats] xn0live:
Android 11

Does BBS 100% work without root, is that possible?
[BetterBatteryStats] IronTechmonkey:
There may be some data which the app cannot access if you are not rooted, there are other people here who can speak better to that than I could, but I can testify to the fact that it is still useful even if you are not rooted. IIRC there were a few commands that had to be run via ADB from a computer but after that it works fine on the non-rooted Android 11 device that I am using. The documentation should describe those commands - see post 4 of this thread.
[BetterBatteryStats] david.siebauer:
For those using ADB app control: There is a build in auto permission function, which set all necessary permissions by click, also for other apps like tasker, Naptime...
[BetterBatteryStats] swejuggalo:
I see some stuff being blocked inside logcat. All permissions is granted via adb. The OS in this case is OnePlus version of Android 13. I could look up the exact permission it says it lacks if this is a unknown issue.

Most things seems to work though. It can never get proper readings regarding Bluetooth though. Always claims it's 0% on.

Perhaps this is expected without root?
[BetterBatteryStats] Zilla0617:
Has anyone been able to get this working on stable A13? Thanks
[BetterBatteryStats] Lughnasadh:
It was working on beta A13 so I would imagine it would still work on stable A13. But I don't have it installed anymore so didn't check to confirm.
[BetterBatteryStats] Zilla0617:
Yea I went back a few pages and read that it was working for A13 beta, not sure why it's not working for me on stable
[BetterBatteryStats] Shivasish666:
Hello! Newcomer here.

How do I view per app battery usage in the BBS app (similar to the native Android battery usage settings)? Can't seem to figure it out.

Also can't seem to start the widget.

After installing BBS, battery usage settings in Android does not seem to record and show the battery usage stats. Is it normal?

Rest everything is working fine.

Using unrooted OnePlus 7 Pro running on A12.

Thanks!
[BetterBatteryStats] david.siebauer:
Hello,

did you set the ADB permissions?
[BetterBatteryStats] Utini:
@chamonix

Just noticed after updating from A12 to A13 that BBS wasn't working anymore.

Checked this thread and found out that you updated the app.

MANY MANY THANKS!

All BBS features now fully work for me on A13 :)

Just a quick question:

The filename of the xda version says "debug". Does that mean additional debug runs in the backround when using the xda version or is the debug just optional from the settings -> advanced menu?
[BetterBatteryStats] Shivasish666:
Yes, I have successfully set the adb permissions. Now everything is working well. Except that the Bluetooth readings aren't accurate and I cannot access the widget.

Any advice?
[BetterBatteryStats] david.siebauer:
Which version are you using? Latest from july 31st? Unfortunately it does not work properly for me on one UI 5 beta.
[BetterBatteryStats] david.siebauer:
Sorry, I have no ideas
[BetterBatteryStats] chamonix:
Debug refers to the key used for signing and for the ability to attach android studio to the app for debugging. There is no overhead in that
[BetterBatteryStats] gerega:
Hi,

I have set

$ adb shell settings put global hidden_api_policy 1

Now, I dont need BBS anymore. How do I reset the value (default)?

Thx!
[BetterBatteryStats] Lughnasadh:
Do the same thing but put a 0 at the end.
[BetterBatteryStats] iakoboss7:
same here, did you find any solution?

@chamonix
[BetterBatteryStats] Utini:
Hi guys,

now that BBS fully works again with latest Android, I thought I would my problem/logs again to see if anyone can help this time.

When at home (e.g. testing with BBS during the night) or general usage during the day, I get like instant deep sleep when the screen is off.

I have like Deep sleep 90% and Screen off (awake) 10% after a whole day.

At work it is more like Deep sleep 65% and Screen off (awake) 35%.

I am on WiFi in both cases but I probably use my phone more frequently for small tasks (e.g. phone calls) when at work.

Still, thanks to BBS, I can see that at home the device goes nearly instantly into deep sleep.

Attached are screenshots and logs from here at work with from/to screen off/on.

Those logs are really short but you can see that it takes several minutes until the devices goes into deep sleep.

Can anyone figure out the reason for that and how to fix it?

One thing that differs between work and home: My eSIM has a lot worse signal at work.

Thanks in advance!
[BetterBatteryStats] iakoboss7:
uninstall, reboot, install somehow fixed it.
[BetterBatteryStats] swapyworld:
About above code mentioned in Post 4, in case of Android 11 and above only last line needs to be executed mentioned under heading '

SDK29 (Android 10 and following)'

and no need to execute 2 lines mentioned under heading '

SDK28 (Android Pie / 9)'.

Is my understanding correct?

Update:

Post installing and opening the app, code lines are already written in their already. Sorry for the trouble.
[BetterBatteryStats] curiousrom:
Your logs failed to attach to your post. Try zipping them.

***
[BetterBatteryStats] Utini:
Oh crap - sorry.

They are now attached as zip.
[BetterBatteryStats] pjadec:
log/dump time too short ( 20 min and 6min ) should be about 6h min

Attached file for examble
[BetterBatteryStats] Utini:
Did you even read my post?

My problem lies within how slow my device goes to deep sleep after leaving it alone.

I have no troubles being in 99% deep sleep during a 6h screen off/screen on.

But ofcourse I can provide a log with since unplugged to current that is 6-12h long, if that helps?
[BetterBatteryStats] pjadec:
if the log/dump is too short, it is quite impossible to analyze it. Or there will be too many guesses that may be wrong. A longer log/dump makes it much easier to analyze the data in more detail. because some process keeps the phone awake or wakes it up every once in a while. In which case the battery wears out faster
[BetterBatteryStats] TNSMANI:
Apart from what other users commented, trying to compare the behaviour of the phone for a short duration of about 13 minutes with its behaviour during the whole of the night (in idle state) is like comparing chalk to cheese. BBS, to my knowledge , was not created for reducing the drain during the day time. It is being used to study the phone's behaviour during the idle state (for 6+ hours) to identify the drainers and to contain them, if possible, so that the in-use drain during day time would also reduce. To my knowledge, it was never used/intended to be used, for studying the phone's behaviour over a short time of about 13 minutes.

You are talking in percentages while saying that the phone takes longer to go to sleep during day time, when compared to its behaviour during the night. You should be aware that a 'awake (screen off)' time of about 6 minutes out of a total dump file time of 13 minutes will constitute nearly 50% of the total time. The same 6 minutes when compared to the 6+ hours in the idle dump file will constitute a negligible percentage. So taking percentages in this case, especially since we don't have an idle dump to compare, is not correct.

We may not be able to help you identify what exactly causes the phone to be awake longer during daytime using BBS but if an idle dump is provided, we will study it and try to help you in reducing the drain.

Hope that what I said above is not confusing and makes sense.
[BetterBatteryStats] swejuggalo:
I'm running 3.0-485 (102).

It wants some extra permissions.

Process: com.asksven.betterbatterystats_xdaedition, PID: 23669

08-25 10:14:42.106 23669 23669 E AndroidRuntime: java.lang.SecurityException: getPackagesForUid: UID 10403 requires android.permission.INTERACT_ACROSS_USERS_FULL or android.permission.INTERACT_ACROSS_USERS to access user 10.

I thought I had granted it once already, but it somehow did not work or got lost.

Is this something that can be solved, or is this forced to be granted by the user?

If having certain stats scrolling within wakelocks for example can force close the GUI of the app.
[BetterBatteryStats] oile:
Latest version doesn't work on latest A13 one ui 5 beta too. S22 exynos
[BetterBatteryStats] Utini:
I understand. Well here are two logs then from two typical work days (although today I had not many phone calls). Each log is about 8-9 hours.
[BetterBatteryStats] TNSMANI:
I think that you have misunderstood what I said. An idle dump file is required, not an in-use dump file.
[BetterBatteryStats] Utini:
The idle dump file will look fine. No issues there. It is during daily usage where I have problems.

Except maybe an idle dump file in my office environment but that is hard to test since I can let my phone idle for several hours during a worl day.
[BetterBatteryStats] DiamondJohn:
This is not the app / method for that need.

Things I would look at is your state of doze and battery drain and wake up app and mobile signal strength and wifi strength etc etc etc. I have built an app (TeMeFI) that show these graphically. Check (just to name a few)

Currently Running>Doze>Doze Cycle graph>*

Currently Running>Battery>Battery History Graph>*

Currently Running>Battery>Battery History Extras>*

The last one in particular has many many many sub options to help you identify what is draining your battery.
[BetterBatteryStats] Adbnpk2013:
i am facing extreme battery drain, about 10-15% per hour.

after checking with bbs, I found that USB_notify and DWC3-otg are the main culprits in the kernel wakelock.

can I disable these two? if yes, then how?

your help is appreciated.
[BetterBatteryStats] TNSMANI:
I don't know about these two wakelocks but kernel wakelocks are usually not controllable unless they vanish by a reboot or factory reset. The only option may be another compatible kernel, if available.
[BetterBatteryStats] david.siebauer:
Only Alarms and CPU States is working for me on one UI 5 Beta 2.

Build.VERSION.RELEASE: 13

Build.BRAND: samsung

Build.DEVICE: r0s

Build.MANUFACTURERsamsung

Build.MODEL: SM-S901B

Build.VERSION.SDK_INT: 33

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)

invoking getStatisticsStream

retrieving parcel

FAILURE: an exception occured

STACK TRACE

android.os.ParcelFormatException: inconsistent tx state lengths

at com.android.internal.os.BatteryStatsImpl$ModemTxRxCounterImpl.<init>(BatteryStatsImpl.java:4284)

at com.android.internal.os.BatteryStatsImpl$ModemActivityCounterImpl.<init>(BatteryStatsImpl.java:4395)

at com.android.internal.os.BatteryStatsImpl.readFromParcelLocked(BatteryStatsImpl.java:20973)

at com.android.internal.os.BatteryStatsImpl.readFromParcel(BatteryStatsImpl.java:20832)

at com.android.internal.os.BatteryStatsImpl.<init>(BatteryStatsImpl.java:13854)

at com.android.internal.os.BatteryStatsImpl.<init>(BatteryStatsImpl.java:13841)

at com.android.internal.os.BatteryStatsImpl$9.createFromParcel(BatteryStatsImpl.java:21427)

at com.android.internal.os.BatteryStatsImpl$9.createFromParcel(BatteryStatsImpl.java:21425)

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

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

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

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

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

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

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

at android.app.servertransaction.ActivityTransactionItem.execute(ActivityTransactionItem.java:45)

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:2549)

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

at android.os.Looper.loopOnce(Looper.java:226)

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

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

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

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

at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1067)
[BetterBatteryStats] xn0live:
How can I reduce it?

com.google.android.providers.media.module (com.google.android.providers.media.module.Medienspeicher): Uid: 10206 Sys: 11 h 45 m 8 s Us: 2 h 29 m 16 s Starts: 0
[BetterBatteryStats] IenAnzhelo:
The BBS (v3.485) I installed does not collect any data. It still give "Fallback since Boot" when opening the app. The app permission denied on EACCES.

Using Android 9 phone (not rooted). Also, input the adb command for the hidden api access.
[BetterBatteryStats] TNSMANI:
Did you reboot afterwards?
[BetterBatteryStats] IenAnzhelo:
Yes, I reboot the phone after finish inputting all the adb commands.

If I use other version (v2.6-382). I get different error. "Transaction failed on small parcel; remote process probably died."
[BetterBatteryStats] xn0live:
Version 3.0-485 (102)​

is that the newest?
[BetterBatteryStats] Oswald Boelcke:
According to the in post #2 linked App Center, affirmative.

Spoiler content hidden.
[BetterBatteryStats] chamonix:
Last build now also starts rolling-out on gplay (10%)
[BetterBatteryStats] decal08:
Greetings! Got a new phone a few months back, and even after tweaking a lot, wasn't really happy with screen on time. I tried logging with BBS overnight, came out with 0.4%/h level lost. I believe it's already decent, but wanted people's expertise if there are things than can be improved. Logs attached
[BetterBatteryStats] TNSMANI:
Drain of 0.4% is good on A12. As far as I can see, nothing jumps out but Alarm stats are not registered on BBS.

In use drain is based on many variables and so we don't consider it.
[BetterBatteryStats] decal08:
Understood. It makes sense, regarding the use drain. At least the drain on idle is within the good range.

May I ask what do you mean by 'Alarm stats are not registered on BBS'?

Is it supposed to be registered, and was just not found in the logs (and how to enable them in case)? Or bbs does not register them at all?
[BetterBatteryStats] TNSMANI:
Sorry, I didn't notice the Alarms stats in the dump file yesterday. It is there as expected.

I don't know which app it is, but if you can somehow control the number of times it updates, it may help in lesser drain, but only marginally.
[BetterBatteryStats] alboon2000:
Hi,

I have a Oneplus 8T with Nameless ROM. Since July I have battery drain (sometimes 30% during a 6hrs night), and I can't find what causes that...

I let my phone an hour without touching it and printed this : is it helpful ?

Thank you.
[BetterBatteryStats] Oswald Boelcke:
Negative, it isn't.

Please provide an idle dump of at least 6 hours with less than one minute screen-on-time as described in the thread's OP:
[BetterBatteryStats] alboon2000:
OK.

I wanted to force the app into english, rebooted, but it still is in french (it's installed as system app).

So I suppose the setting I have to check is : "settings/watchdog/watchdog at startup" ?

Because there is also a setting called "active surveillance" (?) just below "watchdog" setting, it contains a warning saying it has an impact on the battery.
[BetterBatteryStats] TNSMANI:
You have to enable Settings>Watchdog>Reference on unlock. Or as you say 'watchdog at startup'.

Not Settings>Active Monitoring which is below Watchdog.
[BetterBatteryStats] alboon2000:
Well... I had 97% deepsleep tonight so it's not this dump that will help me :)

But I'm starting to think that it could be related to the fingerprint sensor : in my ROM, I checked the setting "long press on the fingerprint sensor unlocks the phone", and sometimes the FOD shows, sometimes it doesn't. Tonight it didn't.
[BetterBatteryStats] DiamondJohn:
A couple of points:

The doze graph is a little OT in this thread.

The doze graph is not related to your statement of "last night" Your graph only covers 1hr and 24 minutes.

It looks like you were using your phone during the time. BBS is about idle dumps

The cartoon bomb icon in the top right corner tells you you had an error, possibly last week, or when generating this graph. but you havent cleared it (long press)
[BetterBatteryStats] alboon2000:
You're totally right, the graph is not relevant, it was just to show the phone has trouble switching to deep sleep.

Anyway : last night I lost 13% in airplane mode, so here is the dump.

PS : I try to attach BBS dump but I don't see them in my posts ?

Here is a cloud link :

first night

second night
[BetterBatteryStats] TNSMANI:
If the 'second night' dump file is on airplane mode. then the drain is too high. Try a factory reset. If there is no improvement, you may have to clean flash the ROM. What is the age of the battery?
[BetterBatteryStats] alboon2000:
First night (-3%) : airplane off

Second night (-13%) : airplane on...

So I think there is a bug somewhere, and the battery is not faulty. My 8T is about 18 months old I'd say.

I already tried factory resets, clean rom flashes, but it didn't change anything.

In the second dump, do you see what's using the battery so much?
[BetterBatteryStats] TNSMANI:
In airplane mode, my understanding is (subject to correction), all the apps should behave since no internet or mobile signal is available. In fact, previously we used to say that such a dump is your baseline for drain which cannot go below that. It may not hold good any longer, I don't know. But your apps, almost all behave as if they have internet/data and make repeated attempts to connect. This is especially true of Whatsapp in your case. There are others too.

I don't think that the apps are to be blamed. Whatsapp has become very battery-friendly now. If I were you, I would try another ROM.
[BetterBatteryStats] ze7zez:
The exception is dialing the emergency number n.e.g. 112 in Europe in airplane mode, because the subsystem turns on RIL.

There may also be another exception if the user roots the phone.
[BetterBatteryStats] xn0live:
Hi, is that the newest?

Version 3.0-485 (102)​

Can anyone explained

Reference overview

there are a lot of text for what is that?
[BetterBatteryStats] ze7zez:
The version 3.0(102) is here:

BBS | F-Droid - Free and Open Source Android App Repository

Monitoruj zachowanie baterii dzięki lepszym statystykom baterii

f-droid.org

Issue Tracker is here:

Issues · asksven/BetterBatteryStats

An attempt to provide advanced battery stats for Android - Issues · asksven/BetterBatteryStats

github.com

What exactly are you asking?
[BetterBatteryStats] xn0live:
What is that for a Version? Because now i have to BBS😅

I mean txt file if you scroll down u see that point, there a lof of text/informarion:

Reference overview

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

ref_boot: Reference ref_boot created 19248 d 12 h 42 m 4 s (Wl: 96 elements; KWl: 32elements; NetS: 105 elements; Alrm: 3 elements; Proc: 488 elements; Oth: 16 elements; CPU: 16 elements; Sensors: 12 elements)
[BetterBatteryStats] DiamondJohn:
My turn....:cowboy:

So, I recently changed from Stock A11 on a Pixel 4a 4G to a custom ROM (Bliss A11), and my idle drain nearly doubled, with basically the same config (apart from all the extras of the new ROM). I went from <<1% to up to 1.5%:(

I ran BBS last night, and I *think* I followed all the instructions 🤞. The little differences I did do include:

Ran it in flight mode. it sat at the very edge of my WiFI reception, and on previous nights, without BBS, it didn't make a notable diff to the drain

Even in flight mode, the GPS was on (bug in ROM maybe) :unsure:

Since the phone was resting I took an extra nap, and left it for 9h+:sleep:

I am rooted, and granted root to BBS

When I first installed/ran BBS, the root request was blocked by another window, so I manually went into Magisk and allowed it after the fact; hopefully it didn't store the T/O denial in BBS

I re-booted after install, but the boot was dodgy, so re-booted again.. I think ViperFX causes the odd boot failure. Not sure, but a reboot solves it. I had the issue from Day 1 of this phone

If I have done ANYTHING slightly below par, do not hesitate to send me back for another attempt.

I had a quick flick through the text results, and although I do not understand the report to any great extent, things that stuck out even to me were:

Process "sh"? maybe I have an errant shell script that isnt dying and exiting? I do run a LOT of shell scripts on my device. If it is a concern, let me know and I'll look deeper into it.

org.satok.gweather is a weather widget, of which I have MANY. Normally when I re-setup my device I manually check to lower the default update interval; maybe I missed a few

9h on the sensor? is that saying the sensor was triggered constantly or that it was simply listening?

Attached is the LOG, and some screenshots I took for posterity sake ;)

Many THANKS in advance. You guys are unbelievably giving with your time and assistance.(y)

EDIT: Hmm just saw the 13+ Android wakeups per hour in the screenshot
[BetterBatteryStats] TNSMANI:
OK, but a dump file with wifi and data on would be helpful. And if possible, nearer to the wifi and not on the edge of it.

Yes and it triggered some alarms related to Location.

As I said earlier, a dump file with wifi and data on.

Again yes, lot of alarms (6.6 per hour). See if you can reduce it further.

I think that it was merely listening but even that will entail some drain as opposed to not being on at all.

Please see THIS post too as it may apply to you as well.
[BetterBatteryStats] PeQuEsan:
Some time ago, while I was trying another battery stats app, I saw that its "screen on time" was different from what BBS reported... I contacted the dev to tell him, but I didn't receive a positive feedback.

Now that (from Android 12 if I remember well) we don't have an official easy "screen on time" since disconnected in Android stock battery usage stats... I've tested again that app, and also another one... and I must admit that both of them tells me same "screen on time", which is by the way quite similar to the one you can calculate in Android battery usage screen.... but BBS is reporting a different value (little higher... 1:45h android and apps, 2:00 BBS).

What's going on there?

Thanks a lot.