yashsingh1/xdaforums huggingface dataset:
[BetterBatteryStats] thewaywardgeek013:
yep, followed instructions to a tee, even gave permission for "other" user as I use OP8 on Android 13. Here is permissions dump.

requested permissions:
android.permission.DUMP
android.permission.PACKAGE_USAGE_STATS
android.permission.BATTERY_STATS
android.permission.ACCESS_SUPERUSER
android.permission.ACCESS_WIFI_STATE
android.permission.ACCESS_NETWORK_STATE
android.permission.INTERNET
android.permission.RECEIVE_BOOT_COMPLETED
android.permission.READ_PHONE_STATE
android.permission.READ_BASIC_PHONE_STATE
android.permission.DEVICE_POWER
android.permission.QUERY_ALL_PACKAGES
android.permission.GET_TASKS
android.permission.BLUETOOTH
android.permission.WAKE_LOCK
android.permission.FOREGROUND_SERVICE
android.permission.POST_NOTIFICATIONS
install permissions:
android.permission.FOREGROUND_SERVICE: granted=true
android.permission.RECEIVE_BOOT_COMPLETED: granted=true
android.permission.DEVICE_POWER: granted=false
android.permission.DEVICE_POWER: granted=false, userId=999
android.permission.BLUETOOTH: granted=true
android.permission.GET_TASKS: granted=true
android.permission.INTERNET: granted=true
android.permission.BATTERY_STATS: granted=true
android.permission.PACKAGE_USAGE_STATS: granted=true
android.permission.ACCESS_NETWORK_STATE: granted=true
android.permission.READ_BASIC_PHONE_STATE: granted=true
android.permission.ACCESS_WIFI_STATE: granted=true
android.permission.QUERY_ALL_PACKAGES: granted=true
android.permission.DUMP: granted=true
android.permission.WAKE_LOCK: granted=true
User 0: ceDataInode=914681 installed=true hidden=false suspended=false distractionFlags=0 stopped=true notLaunched=false enabled=0 ofs=0 pdm=false instant=false virtual=false
installReason=4
firstInstallTime=2022-11-21 13:29:15
uninstallReason=0
overlay paths:
/product/overlay/NavigationBarModeGestural/NavigationBarModeGesturalOverlay.apk
/data/resource-cache/com.android.systemui-neutral-ODSg.frro
/data/resource-cache/com.android.systemui-accent-cqk6.frro
legacy overlay paths:
/product/overlay/NavigationBarModeGestural/NavigationBarModeGesturalOverlay.apk
gids=[3002, 3003]
runtime permissions:
android.permission.POST_NOTIFICATIONS: granted=true, flags=[ USER_SENSITIVE_WHEN_GRANTED|USER_SENSITIVE_WHEN_DENIED]
android.permission.READ_PHONE_STATE: granted=true, flags=[ USER_SENSITIVE_WHEN_GRANTED|USER_SENSITIVE_WHEN_DENIED]
User 999: ceDataInode=0 installed=false hidden=false suspended=false distractionFlags=0 stopped=true notLaunched=true enabled=0 ofs=0 pdm=false instant=false virtual=false
installReason=0
firstInstallTime=1970-01-01 08:00:00
uninstallReason=0
gids=[3002, 3003]
runtime permissions:
android.permission.POST_NOTIFICATIONS: granted=true
android.permission.READ_PHONE_STATE: granted=true
[BetterBatteryStats] Thebear j koss:
What bbbs app and commands did you use? One plus may be in the same as Samsung as it just got android 13 and I'm sure it is different than on aosp that last build of BBS was built for.

But anyways you used XDA version of BBS and used correct bbsxda command lines after following link? Does your phone work normally and boots up and is usable. No f/C's? Just BBS isn't working? If so I'm guessing it needs adjustment on development side to work on newer android 13 builds that start from stock aosp. Different package names for different phone packages and other proprietary systems.
[BetterBatteryStats] Schroeder09:
What's the default file path for the log? Cats that better battery stats collects? The toast notification pops up so quickly on export that I can't read it or get a screenshot. It has to be half a second.
[BetterBatteryStats] Lughnasadh:
Android>Data>com.asksven.betterbatterystats_xdaedition>Files>Download
[BetterBatteryStats] viclee888:
I bought the app on play store few days ago. Got it working on FoldUI4 (Android 12). Just updated to FoldUI5 (Android 13) today and got the SAME error:

STATUS: Failed: inconsistent tx state lengths

Not rooted, granted all adb commands but that failure message is new. I've reinstalled many times and run the adb commands, same results. Disabled all battery optimizations etc.
[BetterBatteryStats] qodnec:
Hi I need some help diagnosing my deep sleep problems with some excessive alarms.

Currently running a rooted Pixel 7 pro with November update (latest) and kirisakura kernel 1.1.0 with a galaxy watch 4 connected through bt 24/7. My location is turned off normally and only toggled on (using tasker) when using specific apps. Wifi and bluetooth scanning are both off.

The main offending alarms seem to be:

com.google.android.gms - com.google.android.location.ALARM_WAKEUP_ACTIVITY_DETECTION

android - *job.deadline*

android - WifiP2pService Idle Shutdown Message Timeout (when on wifi)

With these alarms my android and com.google.android.gms can go up to 1.5 times per minute. This drops my deep sleep % when screen off to ~60-70% resulting in around 2.5%/h idle drain.

On LTE only i seem to be getting heavy s5100_wake_lock under kernel wakelock but this seems to be the modem so not sure if anything can be done about it.

Does anyone know how to bring down the alarms and increase deep sleep? com.google.android.location.ALARM_WAKEUP_ACTIVITY_DETECTION is the by the the biggest offender and I cannot figure out what is using the location.

I have included two dumps, 1 mostly wifi and 1 mostly LTE as well as some screen shots of the alarms.

Thanks in advance for any help!
[BetterBatteryStats] Oswald Boelcke:
Both files are NOT IDLE dumps. In accordance with the instrctions in the OP, screen-on-time (SOT) maust be less than one minute. In your cases, SOT's are more than 5 respectively 6 hours. I doubt that anybody is attempting to analyse them.
[BetterBatteryStats] qodnec:
Oh right sorry I missed that part of the OP. However, my overnight drain when it's full idle for hours without touching the phone is actually fine. It drops to less than 1%/h. It's only during the day when there is usage on and off that the screen off drain goes through the roof and the alarms go out of control. Is there any way to diagnose the com.google.android.location.ALARM_WAKEUP_ACTIVITY_DETECTION alarms during the day with periodic on off usage since full idle dump will not help in this case?

Thanks for your help!
[BetterBatteryStats] qodnec:
Just to follow up with this, I have uploaded an idle dump of overnight drain where I did not touch the phone for more than 8 hours. No issues with idle drain and the alarms are normal here. This is for comparison with my daytime usage 3 posts above.

I understand that normally idle dumps are used to ask for help in this thread but in my case it seems an idle dump does not contain the info to solve my problem.

Thanks in advance for any help!
[BetterBatteryStats] TNSMANI:
In this thread, we analyse idle drain to find battery draining apps. In-use scenarios are difficult to analyse since it is unique to every single user.

That said, the alarm

gets activated due to location/scanning being on. You might have switched them off in Settings but some apps, especially Google's, can circumvent such restrictions, for instance emergency location. Search for such apps and check.
[BetterBatteryStats] qodnec:
Yes it seems like some systems apps are pinging for location even though all location settings are turned off. When I check what has accessed location recently i can see Google Play Services, ImsService and Fused Location. I am not sure how to bring them under control as there is no reason for these to be triggering alarms more than once per minute.

I guess I will have to dig around a bit more and see if i can find the root cause.

Thanks TNSMANI.
[BetterBatteryStats] tramp20:
Hi,

can I get help?

Since ~1 week I see on my Sony xPeria 5ii (stock rom, unrooted. Android 12) this

Deep Sleep (): 0,0%

Awake (Screen Off) (): 8 h 50 m 36 s 99,9%

UlrDispSvcFastWL (Google Play-Dienste): 8 h 9 m 44 s Count:4 92,2%
[BetterBatteryStats] DiamondJohn:
A couple of the DOZE parameter specifical reference the accuracy and timeout the OS will accept as a position. I have my accuracy set to a big number (ie not accurate) , and my timeout to a small value. So it accepts a really is crappy (1km I think) location and gives up trying really quickly even if it cat get a crappy position (0 sec I think, so the last position would be accepted, I think).

The two I am speaking of are locating_to AND location_accuracy
[BetterBatteryStats] TNSMANI:
You seem to have a bad mobile signal which drains battery fast.

You also seem to have way too many Wakelocks, Alarms etc than I have seen in recent times. Location/scanning is on and is draining battery. And the wakelock you posted is connected to Location.

As a first step, disable location and scanning and place the phone at a location where the mobile signal is better and save another idle dump file and post it here. Let's see the result and then we can advise on other measures.

For your information, atleast one user reported that disabling Google Location History reduced this wake;ock drastically.
[BetterBatteryStats] Utini:
I just did a factory reset because my device drain was huge and I couldnt figure out why.

According to battery historian my GPS was suddenly constantly in use (100%) of the time and android_system was using it.

From the android ysettings "ImsService" has always accessed GPS 0mins ago, even with GPS turned off.

Now after the factory reset it seems to be fine again? 0.8% screen off battery drain.

ImsService still has accesses GPS 0mins ago though.
[BetterBatteryStats] TNSMANI:
The main issue seems to be your mobile signal which is not great. The entire time it was 'Moderate'. That will drain battery.
[BetterBatteryStats] Utini:
Ye can't do much about it.

Will enable dual-sim tomorrow to see if battery drain stays the same or if anything weird happens. That new SIM is used for mobile data and has better signal.
[BetterBatteryStats] qodnec:
Hmmm interesting, I will try these options and see if they help. Did you try changing any other doze settings?

Thanks!
[BetterBatteryStats] TNSMANI:
It may not change anything if the first SIM is going to stay. It will continue to drain searching for a better signal. May be if you removed it, you may see some improvement.
[BetterBatteryStats] Utini:
Understood.

To be fair, I am happy with that amount if drain.

I previously had 4-10% screen of battery drain according to battery historian.
[BetterBatteryStats] DiamondJohn:
I changed EVERY parameter,

Its best to Check Your dozed settings and what history you are getting, before you make any changes. This is a feature for rooted Phones in my app linked in my signature, which als9o has a number of Doze profiles I collected at the time, and all via a UI & it gives you the shell commands.
[BetterBatteryStats] NeGriTa79:
Good evening, my name is Massimiliano and I'm Italian, sorry for the English but I'm using a translator. I have a huawei p20 pro, and for a few weeks it has been consuming my battery really fast, even when I have the screen off. I have a watch gt from huawei, so I always have GPS, BT and WiFi active. I've been using BBS to figure out what's making my battery go down fast, but I can't figure out what. How can I show you the consumption with BBS? Thank you
[BetterBatteryStats] Lughnasadh:
Make sure your phone is not charged to more than 90-95%. Turn your display off (best to do this when you are sleeping) and do not touch or use your phone for at least 6 hrs. After 6 hrs (or more) turn your display on and save an idle dump immediately (screen on time should be less than 1 minute; the less the better) with the Screen Off to Current tabs showing at the top. Then post your idle dump here and someone will look at it.
[BetterBatteryStats] NeGriTa79:
Ok thanks
[BetterBatteryStats] Utini:
Okay, it gets interesting.

After two days/nights with the same 0.8% screen of battery drain, I now added my 2nd SIM (e-SIM) from a different provider.

Suddenly I am at 3.5% screen off battery drain!

Attached is the BBS file.

From what I can see "RILJ_ACK_WL" is now suddenly on top of my wakelocks?

I did a quick research and this seems to be related to having my phone being able to be seen from the "outside network". E.g. when using it as router or modem.

An option like this was enabled in my providers setting.

I have it not disabled and hope that this fixes the issue.

But I am happy to get a feedback from you guys as well! :)

Edit:

Also, can you guys see from the log file if GPS was actively used?

According to battery historian it is "constantly active" by ANDROID_SYSTEM.
[BetterBatteryStats] TNSMANI:
But that drain was only 0.3%. You have a much more serious kernel wakelock:

This seems to be related to SIM cards or eSIM. May be the second SIM you added triggered this since I don't remember having seen this in your earlier dump file. May be switching off 'mobile data always active' in Developer Options will reduce or eliminate it.

And then in Alarms:

and Location related alarms.

The internet connection seems to oscillate between wifi and mobile. Reset your wifi router by switching it off, wait 10 seconds and then switch it on.

Then in sensors, this:

They seem related to something like a gamepad etc with accelerometer. Was any such thing connected?
[BetterBatteryStats] Utini:
This is really strange. I will answer step by step.

s5100_wake_lock:

I found this: https://issuetracker.google.com/issues/210500029

I now disabled the "modem" mode for my e-SIM in my providers settings.

Maybe this will fix the issue. Next step would be to disable 5G and then to disable "mobile data always active".

FairEmail:

Can't do much about it.

It is 2 mail accounts with imap.google.com and my own smtp server.

Oscilation between wifi/mobile:

Where and how do you see that? So that I can check on my own in future logs.

Also, can you see how frequently that happens?

I actually have full wifi signal (5GHz) and my wifi is usually very stable as in not noticing any issues when streaming, browsing,...

But I will restart my router today! :)

Sensor: Dynamic Sensor Manager(1), wakeup=true, Time: 7 h 25 m 4 s

No idea what that is. Never had any gamepad connected. I also have pretty much all "motion" features except "Flip to Ssshh" disabled.

Could I see more infos about this with battery historian? I have a bug report for it but no idea where to look.
[BetterBatteryStats] TNSMANI:
Check the Network section. The downloads oscillate between wifi and mobile data. It is not very bad but it happens. The ideal when wifi is on is that only wifi should be used.

Since I have not used Battery Historian or for that matter any other battery checking app other than BBS, I am unable to answer that. THIS is where I found the info about this sensor (about middle of the page) since I hadn't seen that sensor before.
[BetterBatteryStats] qodnec:
Oh thanks for pointing out your app. Looks very useful. I've only been using naptime for the past few years. Will try yours and some custom settings.
[BetterBatteryStats] nortuzar:
Hi, first off all thanks for this great tool!

I just bought a galaxy s22 ultra and I´m loosing like 10-15% overnight with a lot of conservative settings like

Power saving ON

Mobile data OFF

Do not disturb

Always on display OFF

Location OFF

Bluetooth OFF

Wifi ON (good signal)

So I make my first test with BBS and its pretty clear that HOME ASSISTANT app is not letting the phone go to deep sleep.

MmapPlayback (io.homeassistant.companion.android.Home Assistant): 6 h 40 m 19 s Count:26 99.6%

I manually set it to Unrestricted on battery permission, maybe change it to optimized could fix it?

Is there any advice to investigate this MmapPlayback?

I dont know why the txt file is not getting attached, I will leave the code here while a search for a solution

BetterBatteryStats-2022-11-29_055404893
[BetterBatteryStats] Utini:
Seems like I got it fixed by simply deactivating the "router/modem" mode in my providers settings.

Some providers have this option enabled/disabled in the APN Settings.

The following log looks a lot better I think?
[BetterBatteryStats] Cuberg:
Using latest BBS from XDA currently (tested with Play Store version too, both beta and not)

SM-908B, S22 Ultra with OneUI 5

Granted all the required permissions through ADB, getting "BatteryInfo could not be contacted" in app, and "Inconsistent tx state length" in logs

Part of logcat: https://pastebin.com/Vn06MVnF

Previously installed AccuBattery worked fine

Posted just to confirm the issues, reported by others
[BetterBatteryStats] Martezgarki:
Having read through this thread, I believe the app is currently not working for phones with Samsung OneUI 5.0. Initially thought it's an Android 13 problem but seems like it affects only the Samsung users.

I have a phone with OneUI5.0 as well and is encountering the no stats/inconsistent tx state length problem.
[BetterBatteryStats] TNSMANI:
Yes, it is much better. Good that you found your solution.
[BetterBatteryStats] TNSMANI:
Samsungs always had a problem with BBS unless the OP specifically targeted the issue with them and solved it. But every new iteration brings its own problem.
[BetterBatteryStats] Sea-Wolf:
I think you might be right. I'm using a S22 Ultra with OneUI 5.0 and BBS is crashing on startup for me. I've carefully checked the permissions and they're all correct.
[BetterBatteryStats] chamonix:
Unfortunately I don't buy any Samsung devices so at this point it is guesswork. Can you please send me a screenshot of the Diagnostics screen from the advanced settings?
[BetterBatteryStats] chamonix:
Confirmed, this the known issue where Samsung has broken the battery_info service. I had a working hack around this so I will try the update an old S8 I have and try reproducing
[BetterBatteryStats] V6-Maniac:
Maybe in handy for you to know while trying to reproduce.

On my Flip Z 4 Android 13 the app behaves as expected when it's idle overnight.

But during the day it crashes (so while the phone is use) and it will never work again until i clear entire app data.

Tested this while using the default One UI and with Nova Launcher
[BetterBatteryStats] _theluk_:
@chamonix not sure if it helps since you seem to know already what the issue is: on my S22 Ultra (Android 13, OneUi 5) I receive the previously mentioned error "Inconsistent tx state length" only after granting all permissions and allowing access to the hidden API WITHOUT restarting. After restarting, so I assume when the API access really works, the app crashes as written by others already. This happens both versions (playstore, xda) but I assume they're identical, so no big suprise. Thanks for looking into it. Looking forward to continue using the great app on my new phone
[BetterBatteryStats] linom:
Yeah, it would be great to have the app working on Samsung S22U/OneUI 5.0. There is nothing detailed like BBS out there.
[BetterBatteryStats] shaggyskunk:
Not exactly a "good" thing - But at least I know that I'm not losing my mind - My S20 Ultra Snapdragon variant just updated to One UI V5.0 & I was trying to figure out what was going on with BBS .. At least now I can understand 🙂
[BetterBatteryStats] chamonix:
Yes both apps are identical except the signing key and the package name.

There has been issues with Samsung in the past (permissions related to Knox) and I will try these first. The issue is to reproduce and I hope I can on my old S10.
[BetterBatteryStats] shaggyskunk:
This is odd - BBS seems to be working now - After a day or so & I haven't changed anything since when it was crashing on opening.

Samsung Galaxy S20 Ultra Snapdragon variant running One UI V5.0.
[BetterBatteryStats] shaggyskunk:
Well, BBS wasn't working - Then it was & then it wasn't (immediately force closing) - now it's opening but no data collected.

I'll send the logs - hopefully with some useful information 🤞🏻 via PM 🕊️
[BetterBatteryStats] sshriss:
Hi, I am using Oneplus 9Pro with Oxygen OS 13, and the app is crashing (sometimes just disappears) when I scroll thru Partial wakelocks. Based on my tests it is the only place where it crashes and when there are a lot of wakelocks in the list. I collected some logs and shot video. I will send them via PM. It would be great if you can have a look.
[BetterBatteryStats] shaggyskunk:
Thanks for the update to BBS 🙇🏼

Will let you know 😊🕊️
[BetterBatteryStats] chamonix:
New builds coming in: Google (again) is nagging me about the app permissions. I had to remove QUERY_ALL_PACKAGES that is used to retrieve icons and info about apps. Please let me know if anything breaks by removing these permissions! I have no choice than comply since this would cause the removal of BBS from g-play (again!)
[BetterBatteryStats] chamonix:
I am seriously fed-up with Google's policies. Yes I understand privacy but since BBS is not a banking app (that of course shoud be able to sniff app "neferious" apps) I have to remove a permission that may have a negative impact on user experience. I am seriously think of pulling from the app store since I have spend my weekend working on that Google warning instead of trying to understand the Samsung issue.

I am wondering what you guys think: would you accept and understand and accept a Paypal (or any other patreon) model if I would drop G-Play alltogether to focus my energy on fixing user issues instead of navigating Google's?

Please let me know what you think!
[BetterBatteryStats] shaggyskunk:
V3.1-493 is Force Closing instantly on my S20 Ultra Snapdragon variant running One UI V5.0. as was the previous version updated today.

I can't say anything about whether or not you want BBS to remain on the Play Store, and I don't know if removing any permissions is the reason, but if it is not working.. I don't know 🤔🕊️

Thank You for your time & efforts! 🙇🏼

I was typing at about the same as you I think, but I didn't want to suggest pulling it from the Play Store, as I feel like that would have been a bit too presumptuous on my part. But yeah I agree with your thinking!

PayPal, Patron whichever works for you 👍🏻
[BetterBatteryStats] IronTechmonkey:
To say I'm not fond of Google is an understatement but since I have devices that are registered to a Google account I do find it procedurally easy to pay for apps that are in Play Store. That being said, some very good apps are not available in Play Store and for those (which would include BBS) I'll follow the app out of Play Store and be willing to pay by other means. That's easy to say, but there are probably are many users who prefer a Play Store update path - something I've seen even for apps which are also available in outside Play Store.
[BetterBatteryStats] Lughnasadh:
First of all, latest version is working fine for me on my Pixel 7 Pro (Android 13). Thanks for the update!

I think you should do whatever is best for you. Users can adjust. The amount of time you have to spend dealing with Google's shenanigans is ridiculous. First and foremost, be good to yourself 😀
[BetterBatteryStats] shaggyskunk:
I'm getting this on the latest version - But it isn't Force Closing immediately 👍🏻
[BetterBatteryStats] Schroeder09:
How do I determine what is causing the this?

*alarm* Google play services

It's got lots of wake ups.2801 over the course of today and I believe is to blame since updating to the December 2022 on my p7p
[BetterBatteryStats] TNSMANI:
This no way to use BBS. Please read the first few posts of the OP and follow the links that are there and read those also. You may find the answer to your query there. AFAIK, this is a collection of wakelocks created by various apps in your device and not Google's alone. And whether they happened during use of the device or during idle periods also matters.

If possible, please save an idle dump file as outlined in the first few posts of this thread and post it here and we will attempt to help you.
[BetterBatteryStats] V6-Maniac:
V3.1-493 is Force Closing instantly on my Galaxy Z Flip4 One UI V5.0 as well did the previous version.

Was able to get some log right after the crash.

Hope it helps...

edit:

Zipped the logs, couldn't attach the logcat
[BetterBatteryStats] Schroeder09:
Thanks man. So I just press the share button inside the app and select dump file?
[BetterBatteryStats] TNSMANI:
Yes, provided you have done all the required steps beforehand.