yashsingh1/xdaforums huggingface dataset:
[BetterBatteryStats] tze_vitamin:
My device is not rooted, I use ADB and successfully manage to do first two command, but third I got error in ADB

this error I get for PACKAGE_USAGE_STATS in adb

PS C:\Users\void_\OneDrive\Desktop\adb - platform tools v28.0.0> adb -d shell pm grant com.asksven.betterbatterystats_xdaedition android.permission.PACKAGE_USAGE_STATS

adb : The term 'adb' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the

spelling of the name, or if a path was included, verify that the path is correct and try again.

At line:1 char:1

+ adb -d shell pm grant com.asksven.betterbatterystats_xdaedition andro ...

+ ~~~

+ CategoryInfo : ObjectNotFound: (adb:String) [], CommandNotFoundException

+ FullyQualifiedErrorId : CommandNotFoundException

Suggestion [3,General]: The command adb was not found, but does exist in the current location. Windows PowerShell does not load commands from the current location by default. If you trust this command, instead type: ".\adb". See "get-help about_Command_Precedence" for more details.

PS C:\Users\void_\OneDrive\Desktop\adb - platform tools v28.0.0>
[BetterBatteryStats] tze_vitamin:
When I open app I also get info FAILBACk to "since boot"

Widget also not working, not showing stats .

I am on CorvusOS A12
[BetterBatteryStats] Elberens:
I am facing similar issues on Xperia 10 iii Android 12.

The app is granted all the permissions, however the stats are not showing

UPDATE: Nevermind, after an hour the stats started showing
[BetterBatteryStats] tze_vitamin:
For me not. I waited for almost 2 day and still nothing.. not showing
[BetterBatteryStats] famusc:
Hi guys, is there any other app you know to have a list of kernel wakelocks? I'm on Android 12 and BBS works but no kernel wakelock list... Thx
[BetterBatteryStats] Elberens:
OK so Wakelocks are not showing in the app, however when i save the log they show up in the log file. Kernel Wakelocks are not showing though. I understand they are different stats.
[BetterBatteryStats] bunklung:
Is there a reason why this information isn't front and center for Android 12? This was the only way I could get this working on my Pixel 5.

android 11 error · Issue #876 · asksven/BetterBatteryStats

Hello, I'm using beta 2.6-378 on android 11 stock (not rooted). the device is a samsung a42 5g. I have installed the apk and given the permissions using adb, but it doesn't work. See the screenshot...

github.com
[BetterBatteryStats] Jan872:
Hi, on my device it shows 'no stats have been collected'. It was working before, and I didn't change anything. I re-installed the app, nothing. Tried the F-Droid version, still nothing. When clicking on 'raw stats' I get the message 'batteryinfo service could not be contacted'.

Any solution for this?
[BetterBatteryStats] TNSMANI:
Would you care to provide some info about your device and Android version?

And did you read atleast the last few pages of this thread?
[BetterBatteryStats] aadeshiscool:
Got a doubt here,

under kernel wakelocks it gives me this

[Here], the totake duration of PowerManagerService.WakeLocks is 5 minutes 54 seconds and from what I understand, PowerManagerService.WakeLocks means the sum total of all the partial wakelocks but the total duration of partial wakelocks it shows to me as

[this], it literally just shows as 1 second. Can someone help me figure this out? Wanna block the unnecessary wakelocks

Also another thing i noticed was that PowerManagerService.WakeLocks kept increasing everytime i refreshed the stats?
[BetterBatteryStats] Staartvin:
It's interesting. I have a Redmi note 10 pro with PixelExperience ROM, but I have the same issue. I get the "transaction failed on small parcel" error for the status on the app permissions page. Moreover, I get "When clicking on 'raw stats' I get the message 'batteryinfo service could not be contacted'" as well.

I have tried many different versions of BBS, but it doesn't not seem to go away. I've also tried the

adb shell settings put global hidden_api_policy 1

but it doesn't work either.

I would be very interested in a fix for getting BBS to work.
[BetterBatteryStats] xn0live:
which app version working for android 12
[BetterBatteryStats] tze_vitamin:
I am using 2.6-382. working good ,every permission also everything working.
[BetterBatteryStats] starbright_:
I used the 2.6.382 (XDA)

I get no statistics and it reports: STATUS: Failed: Transaction failed on small parcel. Remote process probably died.

(If have tried that as root or without root an manually apply permissions).

This problem is on S10e (LOS19) while it is running on Tab S5 (same LOS 19). Anything I can report to maintainer?
[BetterBatteryStats] TNSMANI:
Did you check THIS?
[BetterBatteryStats] daekdroom:
It might be an issue particular to LineageOS 19, as I did run the additional permition on terminal and BBS still doesn't show all statistics.
[BetterBatteryStats] tze_vitamin:
For me working everything.. every permission but widget won't work
[BetterBatteryStats] tze_vitamin:
how to make this wigdet working again? all permsion is allowed , phone is rooted.. only this wigdet is killing me
[BetterBatteryStats] starbright_:
This

adb shell settings put global hidden_api_policy 1

doesn't change anything. It still says: no statistics
[BetterBatteryStats] starbright_:
I run LOS19.1 on two different samsungs. S5e (Tab) works, S10e not.
[BetterBatteryStats] xeGox:
Also for me.

Xiaomi 12, unlocked bootloader and xiaomi.eu rom installed.

Android 12
[BetterBatteryStats] amn1987:
Could anyone please take a look at the attached log? Normally idle drain in the 5+ years old Redmi Note 3 is very good under 0.3%/h but twice in the last 3 weeks or so the device has failed to enter Deep Sleep at all resulting in high idle drain, 3.5%/h. All radios were disabled except cellular which was in 2G only mode, mobile data and Sync off. I couldn't follow the procedure to take logs 100% so please bear with me. It's over 6+ hours of device idle however.

Thanks.
[BetterBatteryStats] TNSMANI:
There is nothing that jumps out. Twice in the last three weeks is hardly a cause for worry. Admittedly the battery is old and likely will die soon. For a 5 year old device, you have one performing alright. If I were you, I wouldn't touch anything and wait for it to worsen and then either replace the battery or the device.
[BetterBatteryStats] amn1987:
Thanks for taking the time to analyse the log. Yeah the battery seems to be weak, It drops several points at a time occasionally and goes up similarly while charging which didn't improve by calibrating it. Still get 7-8 hours SoT though it has declined steeply in the last few months. It's not even a secondary device anymore and it's development seems to have hit a brick wall at A11. Only because of VoLTE support I am keeping it around as in basic handsets 2G calling quality is not up to the mark nowadays. As long as the battery doesn't swell I can use it plugged in taking advantage of what seems to be bypass charging.
[BetterBatteryStats] amn1987:
The issue has recurred. Twice in a row. Idle drain was even higher. Unfortunately I couldn't take logs as the device had been plugged in before I noticed the high idle drain. Yet again the device had failed to enter Deep Sleep. If this continues I might switch to another ROM altogether.

Edit: It turns out it's a well known bug in the ROM wherein once hotspot is used the device never enters Deep Sleep again. Fix is to toggle Wifi on/off.
[BetterBatteryStats] xn0live:
its not always working its show sometimes a error like

"no stats have been collected yet"
[BetterBatteryStats] henfri123:
Hello,

> Before posting a dump please make sure that the references for kernel wakelocks and alarms were processed correctly.

I am not sure what is meant by "references for ... were processed correctly"

Does it mean, that one should confirm that BBS has the appropriate rights (accepting them via Android settings and via adb)?

All app-permissions are ok.

> Reading a dump takes a few minutes and it would be great if you could not waste the time of whomever studies it, aiming at helping you.

Of course. The time of all supporters here is greatly appreciated. I will do my best

> Generally a dump "since unplugged" is better than "since charged". When you start your analysis make sure to follow following procedure:

> - enable watchdog processing in BBS settings

I hope I got that right. That is the drawback of i18n... :) In German the settings are called differently. Would be handy, if one could force the GUI to English (optionally); I have set it to English, but still -despite Device-Reboot - the language is german.

I activated:

Misc -> Watchdog -> activate/start after unlock

Misc -> Active monitoring -> use active monitoring

<<- verify from/to references is checked under custom views

- full charge device then let it run down to ~95%

- put device to sleep for at least 6 hours (no touchy!)

- wake device and launch BBS

- adjust from/to references to 'screen off' and 'screen on'

>>

Clear, but I got "No stats were recorded up to now"

Which is a bit odd... Before I did the 6h without touch, I got stats already.

I get no stats no matter what I sellect as startpoint (Charged, Unplugged). Also if for end I choose "current".

What could be a reason, why I do not get any stats anymore - especially as I did get stats before?

I use Version 2.6-382, by the way.

Best regards,

Hendrik
[BetterBatteryStats] henfri123:
Ah,

See above, yes, I have the same Issue.

I tried now with 2.6 from FDroid.

I uninstalled the RC Version and I cleared the appdata of 2.6.

Sitll, I get "no stats have been collected yet".

Maybe a related observation: under RawData I get a short popup: "Cannot connect to Service BatteryInfo"

So, Identical to https://xdaforums.com/t/app-2-2-05-oct-v2-4-betterbatterystats.1179809/page-1914#post-86816915

The Device is an Samsung S21 running Android 12

I will now start reading the last pages of this thread :)

Unfortunately, applying this https://xdaforums.com/t/app-2-2-05-oct-v2-4-betterbatterystats.1179809/page-1903#post-85903339 did not help -despite reboot and issuing the other adb commands again:

adb -d shell settings put global hidden_api_policy 1
adb -d shell pm grant com.asksven.betterbatterystats android.permission.BATTERY_STATS
adb -d shell pm grant com.asksven.betterbatterystats android.permission.BATTERY_STATS
adb -d shell pm grant com.asksven.betterbatterystats android.permission.DUMP
adb -d shell pm grant com.asksven.betterbatterystats android.permission.PACKAGE_USAGE_STATS

Still, I get "Transaction failed on small parcel"

Edit:

so now what seems to work for me is the latest release-candidate 2.6-382, followed by:

adb -d shell settings put global hidden_api_policy 1

adb -d shell pm grant com.asksven.betterbatterystats_xdaedition android.permission.BATTERY_STATS
adb -d shell pm grant com.asksven.betterbatterystats_xdaedition android.permission.BATTERY_STATS
adb -d shell pm grant com.asksven.betterbatterystats_xdaedition android.permission.DUMP
adb -d shell pm grant com.asksven.betterbatterystats_xdaedition android.permission.PACKAGE_USAGE_STATS

This issue is handled multiple times on the last ~11 pages. It would be great if it could be added to page 1.

Best regards,

Hendrik
[BetterBatteryStats] Zilla0617:
I looked but i did not see version 2.6-362, would you mind sharing the file? Thanks
[BetterBatteryStats] henfri123:
Sorry it is 382 from here https://install.appcenter.ms/users/...stats-xda-edition/distribution_groups/testers
[BetterBatteryStats] henfri123:
Hello,

I now have log of my Samsung S21. I am not impressed by its battery-usage over night - and also not by the drain when using it.

I would greatly appreciate, if someone would be willing to check it.

Opposed to the instructions on Page 1 I additionally set a custom reference before switching the device into idle mode.

I really appreciate the work that went into BBS. Thanks a lot!

Greetings,

Hendrik
[BetterBatteryStats] TNSMANI:
Your mobile signal is patchy and usually it is a huge drainer. Please try to locate the phone where you have the best mobile signal when you try the next idle dump.

Your wifi signal was also not consistent and the phone was alternating between mobile data and wifi consuming battery. Please disconnect any other devices (especially printers) connecting to the same wifi while you take the next dump and also reset your router by switching it off for a minute or two and then switching it on.

No kernel wakelocks registered.

IMS (Instant Messaging Service) had a lot of alarms.

Location/scanning was on? Do you require it while sleeping?

Widgets also threw a lot of alarms. Try to limit the number of widgets or the frequency of their updating.

Take a new dump after attending to the above or as much of it as possible.
[BetterBatteryStats] henfri123:
Thanks for the quick reply and the detailed Analysis.

I will try to improve Wifi/Mobile Signal coverage for the next dump.

Regarding Location/scanning: I do not need it while sleeping - in fact usually I charge while sleeping as well; so battery drain while (me) sleeping is not relevant.

But my problem is: The mobile is empty before I go to bed.

In order to improve that, I need to improve idle and non-idle battery usage. I start with the idle one, because this is most reproducible...

Regarding IMS: Is there any known way to improve this?

Best regards,

Hendrik
[BetterBatteryStats] TNSMANI:
I can't do anything for the in-use-drain. That will most likely depend on your usage. Idle drain is where most apps are supposed to be asleep (apart from you) and hence amenable to some extent.

Since I don't use a Samsung, I have no idea about IMS. Try googling.
[BetterBatteryStats] trevtdogg:
are you using any apps explicitly to help reduce battery drain?

eg. i'm on android 11 stock rom, but have rooted with magisk and use the apps naptime, greenify, and servicely to help doze kick in faster during idle times and reduce app background usage.

there's other settings changes in stock android that can help too, as well as some other tweaks with magisk modules and xposed modules.
[BetterBatteryStats] TNSMANI:
On Android 9 and later, such apps usually do not reduce the drain. In fact, the opposite may happen. It is always better to control the device's apps natively as far as possible. I have none of those apps on my A11 device, no Magisk/Xposed modules for controlling battery drain and still have 0.3% per hour drain during idle. I ditched them all after A9, though all of them helped in times before that.

It is the experience of not only me but a majority of the users here.
[BetterBatteryStats] trevtdogg:
as far as a i know, there is no other way to induce doze when phone is idle with screen off yet still physically moving, (eg. while walking) than by using something like naptime? at least nothing native in android 9-11.

i agree though that servicely and greenify are not as universally useful to all, but have their place depending on particular apps and usage style.
[BetterBatteryStats] Haghty:
My stock Xperia 1 III suddenly started going from 60% to zero during the night while it's at sleep. I installed BBB without root access, and enabled the three recommended settings via ADB, but I still don't get much stats after several days of testing. Is that because I don't have root access?

I do get some info, though. Main suspect is that the phone runs at maximum MHz 99% of the time, perhaps this is the reason for the crazy battery drain? Not sure why it doesn't do it automatically while asleep.
[BetterBatteryStats] TNSMANI:
If the phone is at max freq all the time, then that will certainly drain the battery. But the issue is what causes such behaviour?

May be you can try the fourth adb command to check whether stats show up. Please read atleast a few posts above yours.
[BetterBatteryStats] xn0live:
ANDROID 12 IS THERE ANY FIX?

Its not always working its show sometimes a error like

"no stats have been collected yet"
[BetterBatteryStats] tze_vitamin:
There is no development anymore? I managed to fix all that , only widget not working...
[BetterBatteryStats] Tamza103:
Hello, i have this constant wakelock lines on freshly installed rom with no 3rd party apps. Is this normal or should i switch to another rom.?

I will post a proper dumpfile tomorrow.

Edit: Posted dump file with ss.
[BetterBatteryStats] TNSMANI:
Wakelocks are normal. As per the dump posted by you, you only had 0.2% per hour of drain despite 3+ minutes of screen on time. I also note that neither mobile service nor wifi was on. Still the drain looks to be good. Start worrying when your idle drain rate crosses 0.5% per hour. Till then enjoy your device.
[BetterBatteryStats] m3nu:
A new alpha just came out: https://install.appcenter.ms/users/...Stats-xda-edition/distribution_groups/testers
[BetterBatteryStats] chamonix:
Note: if your device is not rooted do not waste your time, I an m not there yet...

The cat-and-mouse game with Google continues and a new build is up. This build was tested an Android 12 and a rooted device; I have not given-up on unrooted but keeping pace with Google's attempts to lock down private API is a pain. Once the release has been stabilized I will undust my P6 pro and hopefully get back parity between rooted and unrooted.
[BetterBatteryStats] chamonix:
Since I saw a few mentions of FDroid as a source for BBS in a few posts: I am not the publisher of that app there and I don't know who it is so use it at your own risk. If you know the publisher I'd like to get in touch to fix this unfortunate situation.
[BetterBatteryStats] shaggyskunk:
Thanks for the Update! 🙇🏼‍♂️🕊️🔋
[BetterBatteryStats] Silverspell:
Hi,

First I would like to thank you for the new update ! It's nice to keep your software still updated.

But I noticed this wakelock of 7.2 minutes with 84 count. GSam seems to say it used a lot of battery too.

I was wondering what was causing this ?

Thanks a lot !
[BetterBatteryStats] shaggyskunk:
Here's mine with the latest version of BBS - Only issue that I just noticed is that it Force Closes when trying to change from Summary to Processes.
[BetterBatteryStats] Silverspell:
Also, I forgot to say that I'm on the version 3.0-alpha-1-390 (99) on a rooted Pixel 4a.

Maybe it has something to do with it but I find that it takes a really long time for the app to load my data and to switch the different groups, sometimes like 1 or 2 minutes. Are these normal times ?
[BetterBatteryStats] shaggyskunk:
Yeah - I'm running the same version on my S20 Ultra Snapdragon variant running One UI V4.1 & No it's not normal to take more than a split second to switch.

Edit: Clearing Cache & Data for BBS fixed the FC issue.
[BetterBatteryStats] asripath:
Thanks for the update.

Just a quick feedback....

Works on A12 except for Kernel wakelocks and sensors like previous version (rooted)

Which also had same behaviour on A12
[BetterBatteryStats] shaggyskunk:
Seems to be working just fine on my S20 Ultra Snapdragon variant running One UI V4.1 [NO - ROOT].
[BetterBatteryStats] tze_vitamin:
how did you get this app detail? I can not find it in app???
[BetterBatteryStats] onlineorders3929:
I sense this is high battery drain. Attaching dumpfile along with screenshots. Can someone help me out?
[BetterBatteryStats] pjadec:
This is not good battery dump. Too much screen on time. Then battery dump is plain simple text file. Read instructions from op
[BetterBatteryStats] chamonix:
New build will be up soon:

- added instruction for non rooted devices

- added accent color to gauges (instead of static blue)

- bump to SDK30 since required by gplay

- some minor fixes
[BetterBatteryStats] beeshyams:
@chamonix Thanks 🙏👍👍 for releasing 3. 0-alpha-2-393, accent colors look nice 😂
[BetterBatteryStats] chamonix:
New build with a little tweak: adb command from permissions screen can now be copy/pasted
[BetterBatteryStats] asripath:
Thanks for the update.

Just a quick feedback....

Works on A12L including Kernel wakelocks and sensors ...good build
[BetterBatteryStats] chamonix:
Sorry for the update-bombs :)

Alpha is finished for now so in the next steps I will limit development to fixes so that I can move to beta swiftly.
[BetterBatteryStats] wangdaning:
Was wondering what was up with that, was just going to wait it out, but thanks for the heads up.(y)
[BetterBatteryStats] skiely666:
Maybe get rid of the • in the adb commands? DUMP is fine but the other two are not 👍🏻

Also still not working on Android 13 using LADB, all commands went in with no errors including adb shell settings put global hidden_api_policy 1. I'm aware 13 is still in beta & I haven't had a chance to do adb commands on PC.
[BetterBatteryStats] chamonix:
The formating should be fixed in beta-1 that is building right now
[BetterBatteryStats] Zilla0617:
I keep getting app crashes on the last 2 versions
[BetterBatteryStats] chamonix:
A logcat or it didn't happen :-P
[BetterBatteryStats] Zilla0617:
Lol, next time I will collect a logcat.
[BetterBatteryStats] Zilla0617:
So on the latest version, the widget is not working correctly. The last version with a working widget for me is alpha 412
[BetterBatteryStats] curiousrom:
"Latest version" does not mean anything with the rapid fire of versions the dev is producing @ the present.

Take 2 seconds to copy/paste the file's name.

For example: Version 3.0-beta-1-420 (100)

(Jun 12, 2022 at 09:28)

***
[BetterBatteryStats] onlineorders3929:
I did attach. It didn't get uploaded. Attaching the logcat again.
[BetterBatteryStats] chamonix:
Thanks for letting me know. Since I updated the target SDK to 31 I think this may be related as there are many changes in how events ie refreshes are propagated.
[BetterBatteryStats] wangdaning:
Even though I am rooted I had to force the command for private apis on 3.0-beta-1-420
[BetterBatteryStats] famusc:
Hi, I'm on latest build 3.0-beta-1-420 on a12 rooted and sensor stats are not working. I'm sure I saw them working on one past alpha build... You see sensor stats?
[BetterBatteryStats] chamonix:
New build is up (423) , fixing the widgets

Edit: 425 -> 423
[BetterBatteryStats] chamonix:
Yes I do. Since sensors do not trigger continuously you may want to check if there is some info in the raw stats
[BetterBatteryStats] chamonix:
Are you on a samsung by any chance? Mine is not rooted but I noticed that the setting became active only after a reboot (applying it using ADB)
[BetterBatteryStats] shaggyskunk:
That's because the screen shots are from GSam Battery Monitor
[BetterBatteryStats] Tomo123:
Just to let people know, if you are rooted, you don't need ADB to issue hidden api policy command.

Just start up any terminal, su and issue command "settings put global hidden_api_policy 1".

Also, very glad BBS is back in full force!
[BetterBatteryStats] chamonix:
I will have to check since when rooted BBS is supposed to issue that command in a root shell
[BetterBatteryStats] chamonix:
New build V3.0-beta-1-426 is up, fixing the need to run "settings put global hidden_api_policy 1" on rooted devices
[BetterBatteryStats] chamonix:
As the next step I am looking at publishing on gplay as beta. It would be great if you guys could report success/issues on rooted as well as unrooted devices as well as different android version for an as wide as possible range. If you face issues please add the build and if possible a logcat so that I can narrow down as much as possible