yashsingh1/xdaforums huggingface dataset:
[BetterBatteryStats] chamonix:
Hello friends,

you have not heard a lot from me in the last weeks but I have not been inactive: I am just hitting a wall. The way Android was providing access to battery stats in the past has been changed in Android 14, not letting me access BatteryStatsImpl anymore: this class (com.android.server.power.stats.BatteryStatsImpl) still exists but is not in the path of the classLoader anymore, i.e. it can not be loaded.

I have spent days and days trying to find another way to access the stats but am hitting a wall right now. If anyone has connection to any other dev of an app in the same niche and who has achieved supporting Android 14 I would be very happy if you could reach out and establish a direct contact to get things sorted and gain some knowledge. I believe in the community and am confident that we help each other to progress in the fight against google making our lives more difficult with each release.

Cheers

Sven
[BetterBatteryStats] chamonix:
One of the options would be to go back to parsing dumpsys but I am lokking into different option atm since this would be a step-back and impossible to maintain. Again, Google did this on purpose to try killing our niche of apps creating visibility into the battery consumption and I am not ready to give up that fight
[BetterBatteryStats] rspkt:
We applaud your work and dedication. Hopefully the community can find a good solution for such a priceless app. Much appreciated.
[BetterBatteryStats] curiousrom:
Battery App That Works on Android 14?

I don't know @Paget96 personally but his BatteryGuru: Monitor & Saver works on stock Android 14 Pixel 6. It reports a chop suey of info but not wakelocks & data usage per app when sleeping like BBS does.

I got it from Play Store: Battery Guru: Monitor & Health.

I really hate Google for moving the goal posts with every Android version and breaking stuff that was working fine previously.

Thanks for your incredible dedication supporting BBS for all those years. :cool:

You saved me countless mAh & extended battry life span by making it easy to spot rogue apps.

***
[BetterBatteryStats] Mstier25:
Though I'm Moto Android 11, I also have the StatisticsStream issue. Did you ever find a resolution? After reboot, Diag results show this:

Build.VERSION.RELEASE: 11

Build.BRAND: motorola

Build.DEVICE: denver

Build.MANUFACTURERmotorola

Build.MODEL: moto g stylus 5G

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
[BetterBatteryStats] greyfox13:
Hello. I have Samsung A54 (Android 13). BBS 3.4 beta. No root. All permissions granted from adb.

BBS can't collect stat (always empty).

At import settings app throws exception (logcat from Android Studio):

FATAL EXCEPTION: main
Process: com.asksven.betterbatterystats_xdaedition, PID: 17768
java.lang.NullPointerException: Attempt to invoke virtual method 'boolean java.lang.String.equals(java.lang.Object)' on a null object reference
at com.asksven.betterbatterystats.PreferencesFragmentActivity$PrefsFragment.onSharedPreferenceChanged(PreferencesFragmentActivity.java:103)

At startup app throws:

An exception occured in BatteryStatsProxy(). Message: inconsistent tx state lengths

An exception occured processing kernel wakelocks. Message: null
Exception: com.asksven.android.common.privateapiproxies.BatteryInfoUnavailableException
at com.asksven.android.common.privateapiproxies.BatteryStatsProxy.computeBatteryRealtime(BatteryStatsProxy.java:699)
at com.asksven.android.common.privateapiproxies.BatteryStatsProxy.getKernelWakelockStats(BatteryStatsProxy.java:2825)
at com.asksven.betterbatterystats.data.StatsProvider.getCurrentKernelWakelockStatList(StatsProvider.java:1193)
[BetterBatteryStats] Sk.vignesh:
Tried ROOT & ADB commands not working in Android 14 Custom Roms... only with bbs and i tried Battery Guru: Monitor & Health app suggest above its showing but not detailed as BBS..

waiting for bbs to fix this problem.

Thanks
[BetterBatteryStats] willcor:
GSam Battery Monitor app ,updated their app today

(Non Root VERSION /root ? )

Its working on Android 14 .

Tested on my S23 Ultra Android 14

Info for those members who also uses Both BBS and GSam
[BetterBatteryStats] curiousrom:
Looki here:

Edit: works on Pixel 8 Pro w/ Android 14 stock & no root.

***
[BetterBatteryStats] Watanabe_You:
Anyone see anything weird here? I was planning to change my battery, since I don't like the fast idle drain
[BetterBatteryStats] TNSMANI:
Mobile signal strength not optimal.

Lots of wakelocks for Whatsapp. I don't know why but it has a suffix ".w4b" which I have not come across before. Modded version?

Kernel wakelocks for BT.

Alarms: Heart Monitor - MiBand has 13.7 alarms per hour.

Location/scanning and this:

I don't know what it is but causing too many alarms.

So I think that you may not need a new battery.
[BetterBatteryStats] Watanabe_You:
Ah thanks. .w4b is Whatsapp for Business. I'll try to reduce the heart monitor frequency as well
[BetterBatteryStats] harerton:
Hi,

It seems BBS isn't collecting data.

Here's the diagnostic output:

Build.VERSION.RELEASE: 14 Build.BRAND: samsung Build.DEVICE: t2s Build.MANUFACTURERsamsung Build.MODEL: SM-G996B Build.VERSION.SDK_INT: 34 FAILURE: an unhandled exception occured STACK TRACE java.lang.ClassNotFoundException: Didn't find class "com.android.internal.os.BatteryStatsImpl" on path: DexPathList[[zip file "/data/app/~~NNzcAJ7b43zOrT96hc_mrA==/com.asksven.betterbatterystats_xdaedition-OdarL-BprIudrl1K0Cq73w==/base.apk"],nativeLibraryDirectories=[/data/app/~~NNzcAJ7b43zOrT96hc_mrA==/com.asksven.betterbatterystats_xdaedition-OdarL-BprIudrl1K0Cq73w==/lib/arm64, /system/lib64, /system/system_ext/lib64]] at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:259) at java.lang.ClassLoader.loadClass(ClassLoader.java:379) at java.lang.ClassLoader.loadClass(ClassLoader.java:312) at com.asksven.betterbatterystats.DiagnosticsActivity.diagGetService(DiagnosticsActivity.java:121) at com.asksven.betterbatterystats.DiagnosticsActivity.onResume(DiagnosticsActivity.java:95) at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1603) at android.app.Activity.performResume(Activity.java:9103) at android.app.ActivityThread.performResumeActivity(ActivityThread.java:5399) at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:5507) at android.app.servertransaction.ResumeActivityItem.execute(ResumeActivityItem.java:57) at android.app.servertransaction.ActivityTransactionItem.execute(ActivityTransactionItem.java:45) at android.app.servertransaction.TransactionExecutor.executeLifecycleState(TransactionExecutor.java:180) at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:98) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2685) at android.os.Handler.dispatchMessage(Handler.java:106) at android.os.Looper.loopOnce(Looper.java:230) at android.os.Looper.loop(Looper.java:319) at android.app.ActivityThread.main(ActivityThread.java:8893) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:608) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1103)

Any idea?

Thanks!
[BetterBatteryStats] guhvanoh:
Unravel that for us please. Your device, android version, and BBS version please?
[BetterBatteryStats] DARK7BEAST:
How to fix 'fall back to "since boot" ' ?

please help.
[BetterBatteryStats] thefinger:
[APP][2.2+][11 Dec. 2022 - V3.1] BetterBatteryStats

I started BetterBatteryStats because I was missing the great battery history that Spare Parts allowed to call on Froyo. It has been a long journey since the first version. BetterBatteryStats provides an insight in following categories: - General...

xdaforums.com

BetterBatteryStats has not been updated in a while. Not sure about the status of it now.
[BetterBatteryStats] harerton:
S21+ 5G, Android 14, OneUI 6, no root.
[BetterBatteryStats] TNSMANI:
BBS working on Samsung devices is itself dodgy, on top of that A14 too. Please search for and read comments about Samsung devices on this thread.
[BetterBatteryStats] TNSMANI:
What is there to fix? It is one of the starting points for collection of data by BBS.

If you want, charge the phone for a couple of minutes and remove. Then this will be replaced by Unplugged.
[BetterBatteryStats] DARK7BEAST:
t showing, and no collected data is shown
[BetterBatteryStats] TNSMANI:
What is showing?

Details like your device, android version, custom or stock OS and may be a screenshot of the issue would help in helping.
[BetterBatteryStats] rajwadiv:
It's showing always "No stats have been collected yet"

My phone(VIVO IQOO- 7 legend) is non-rooted, all permission granted through adb commands. suggest me solution please.
[BetterBatteryStats] TNSMANI:
Looks like a permission issue. The screenshot shows 'Status: failed...' (at the top). May be BBS is not compatible with your device/android version.

Did you try rebooting and/or uninstalling BBS and reinstalling it and again granting permissions?
[BetterBatteryStats] rajwadiv:
Device Specification:

VERSION.RELEASE: 14

BRAND: iQOO

DEVICE: 2009

MANUFACTURERvivo

MODEL: I2009

VERSION.SDK_INT: 34

Yes Sir, I rebooted the device. also uninstalled BBS and again granting all the permissions. but same problem accured.

I checked dignostics, following message coming.

FAILURE: an unhandled exception occured

STACK TRACE

java.lang.ClassNotFoundException: Didn't find class "com.android.internal.os.BatteryStatsImpl" on path: DexPathList[[zip file "/data/app/~~rjQijHu6nzKFGzjl5wANpg==/com.asksven.betterbatterystats-gSHzhLJkCKX-1wlTc2g-ag==/base.apk"],nativeLibraryDirectories=[/

please support me for this.
[BetterBatteryStats] TNSMANI:
I think that BBS is not fully compatible with A14 still. Unless the dev is able to make it work, you may not solve the issue.
[BetterBatteryStats] thefinger:
Dev has not been able to fix this one so BBS is not yet fully compatible with A14.
[BetterBatteryStats] rajwadiv:
Sir,

How to contect developer of BBS?
[BetterBatteryStats] TNSMANI:
Please see THIS post by the dev and the next one. That may clarify things to you.

If you want to contact any user or to draw his attention, please tag him in your post. But whether to respond or not is entirely on that user.
[BetterBatteryStats] memocatcher:
Hello, anyone know what this wakelock is for?

*job*/com.motorola.moto/androidx.work.impl.background.systemjob.SystemJobService

Started showing up a few hours ago when screen is off. 70% battery consumption. Its draining my Edge 30 Ultra like crazy. I didn't install any new app or anything else though.

Android 13 btw
[BetterBatteryStats] rajwadiv:
We appreciate your work
[BetterBatteryStats] rpgdev:
Am I doing something wrong? Granting root to the app doesn't work, still shows the screen for the adb commands and doesn't collect any data. Using magisk root.
[BetterBatteryStats] thefinger:
Read a few comments back. It does not work with Android 14.
[BetterBatteryStats] rpgdev:
I'm on A13 rooted.
[BetterBatteryStats] eleiam:
Same here. I got it working one time but had to factory reset and never worked again
[BetterBatteryStats] thefinger:
you guys better reach out to @chamonix and see if he can help somehow. These problems seem very specific. Unfortunately I had to uninstall it because it does not run on A14
[BetterBatteryStats] Walden0:
Hi, I have tried the xda & fdroid versions, both the latest and old upto 3.0 but I have the issue of no stats being collected. i read about the android 14 scene but my device is actually on a13.

here are my device details & modules attached at the end.

if someone can guess what might be the issue or which version I should use , Id be grateful.

---

redmi note 11 (spes)

crdroid 9.12 (android 13) unofficial build

kitsune mask for root, zygisk and magiskhide enabled, magisk package name renamed.

last build of lsposed.
[BetterBatteryStats] TNSMANI:
HI, how are you? Long time no see.

Did you try THIS?
[BetterBatteryStats] Walden0:
Hi Mani sir, im good, how have you been? Delight to see you and Oswald sir again.

No I have not tried anything below the version 3.0, as I thought it would be too old to work properly on android 13, as well as buggy. I will try it now and see if it works.

Thanks for the headsup!
[BetterBatteryStats] Walden0:
Hi Mani Sir , I tried but I could not find that exact version of bbs either on app center , fdroid or this xda thread. Should I go for the Version 2.3-236 (92) from app center ?
[BetterBatteryStats] rpgdev:
Me neither, is it archive somewhere?
[BetterBatteryStats] TNSMANI:
No harm in trying. Also do you get any Failed messages when all the permissions are given?
[BetterBatteryStats] rpgdev:
Btw I tried it and it didn't work for me either with root A13
[BetterBatteryStats] DiamondJohn:
I haven't used this app for a wile, but one general thing to remember, even if you grant root to an app, it is only of use IF the developer explicitly uses root in the app. ie rooting the phone and granting root can still have an app fail on rooted methods, if the dev does not use root for that method. And with security changes between Android versions, something that didnt take root before, may now require root or even a different method / path, as well.

Purely out of interest, hsa anyone checkled their SELinux denials on failure? They also have major changes between Android versions, and can stop apps that previously ran.
[BetterBatteryStats] rpgdev:
You're way out of the loop by bringing this up. This app works well with root in previous versions of Android, I've used it for years including my last phone (that I think was stuck in A10) and I just changed phones recently. The app actually works well without root and granting the perms with adb on stock on A13 so I guess that's still an option but with root it's broken.
[BetterBatteryStats] DiamondJohn:
Yes, Im outa of the loop, but my post was in regards to people posting (many above) about it NOT working on A14 (and from memory A13 as well), not on previous Android versions. And in different versions of android, some things done previously in one way, need to be performed in a different way.
[BetterBatteryStats] Walden0:
no, no such failure messages
[BetterBatteryStats] Walden0:
Hi.Thanks for the headsup, I have not tried the app with adb, I will try that as well as soon as I get a pc to work with
[BetterBatteryStats] leAndroid91:
Hi guys, i have some wakelock issues so i want to use BBS to analyze it.

My OnePlus Nord is running Superior OS (Android 14) since a couple of days.

I installed BBS an ran

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
adb -d shell settings put global hidden_api_policy 1

according to the command line, all succeeded.

The i restarted my phone. After 40 minutes (screen on and off) i took a look into BBS but i can only see

- CPU States

- Alarms

all other show "No stats have been collected yet".

Is that as expected or did i do something wrong?

Thanks for you help!
[BetterBatteryStats] sohebq:
AudioOut_1 is showing in kernal wakelocks. What it is ?
[BetterBatteryStats] cdmackay:
The phone is playing audio :)

I get that when it rings, too...
[BetterBatteryStats] Karpfenhai:
That is not the full truth ;)

disable haptic feedback sounds and swype sounds to bring it down ;)
[BetterBatteryStats] jeremysherriff:
Correct. Not sure why a wakelock is used to play key and softkey sounds, but there you go.
[BetterBatteryStats] o0boiboi0o:
Hey guys, is it normal for the awake time on to be much more than screen time on? I restarted my phone, then left my phone on idle for whole night (~8 hrs). Upon checking, deep sleep is 95% with awake time on 25mins and screen time on 1min. Is this normal? Checked the partial wakelock and its those normal wakelocks like ActivityManager-Launch, ActivityManager-Sleep, and RIJL etc.
[BetterBatteryStats] jeremysherriff:
25min is ok across 8 hours, some people are experiencing awake times of 3hr during the same period. 95% again is "ok", there may be some savings you could get by disabling some features or apps that you weren't aware of. Post up a log file if you would like some advice from the community.
[BetterBatteryStats] voyagertm:
Battery drain

Hi all,

I dont post much on forums, cos I mostly read and try things out myself.

But this somehow I cant figure out.

Previous readings showed awake time almost same time as since unplugged.

Somehow I managed to get it to sleep now and awake time is alot shorter.

But now the battery drain is still 25-110mA during sleep, I got no clue why that is happening.

Got some dumps attached, hope one of you can help me figure it out.

This reading is the first reading that has way less awake time tho.

So its the most relevant atm.

Greets
[BetterBatteryStats] o0boiboi0o:
Thanks! I will post a log file asap to have some good advice from the gurus here. :D

btw are high counts normal as well? I have counts like 1800 for activitymanager-sleep, 1729 for alarmmanager, 778 for keyguardwakeandhandoff, 727 for notificationservice, 707 for RIJL and 676 fir activitymanager-launch. Any ways to reduce these counts for the parital wakelock? :confused: These counts look scary though. Lol.
[BetterBatteryStats] chamonix:
The most expensive wakelocks are:

- alarms, cause mostly by bmw waking up your phone every minute

- syncloop: caused by sync. Known reason: one of the servers that you sync was unreachable or slow
[BetterBatteryStats] chamonix:
That's a pretty damn old version of BBS you are using. Please update and post another dump for us to have more info
[BetterBatteryStats] Razer(x):
With AOKP alarm manager is totally draining my battery out, advices?
[BetterBatteryStats] voyagertm:
Thnx,

Tho bmw is set to 5 min and was said to not drain much battery.

Gonna see what I get without it.

Syncloop, no idea how I am gonna solve that.

Guess gonna turn some off and see wich one is the culprit.

ty for now :)
[BetterBatteryStats] chamonix:
Yes. Post a BBS dump and we will find what's wrong
[BetterBatteryStats] chamonix:
I must correct you: your dump says "Since 4 h 38 m 30 s", thats 278 minutes and your dump says "ccc71.bmw (): Wakeups: 279", that's one wakeup per minute.

You should double check the history settings for the refresh timer.

You should keep syncloop under observation. I see that you sync ICQ and Facebook. Either your phone had poor connection or there was an overload on one of those servers. If the problem persist I would finally question the quality of the service
[BetterBatteryStats] voyagertm:
Ok thnx I will keep that in mind.

My home is in a bad reception area for data thats for sure.

Why I mostly use wifi at home.

Maybe I should run another test at work or so, cos thats in the middle of a city :P

Greets
[BetterBatteryStats] gli8600:
Hi, how do I get to the 3rd(graph) screen? I clicked on the bars and nothing happened.

Cheers
[BetterBatteryStats] jeremysherriff:
Menu -> More -> History
[BetterBatteryStats] o0boiboi0o:
Hi guys,

I have attached my dump file for idle state (~ 6 hrs). Is this information enough for good advise? :D
[BetterBatteryStats] gradesm:
Well, 15 mins awake for 6 hrs is pretty ok. try posting your kernal wakelocks and alarms, may have some stuff you may get rid but on the whole it's pretty ok.

As a side note, you may want to turn off whatsapp autosync in your accounts and sync and manually sync since all it does is sync your contacts.
[BetterBatteryStats] Nightshadow931:
After using this app I realized that maps are draining my battery.

Atm, Awake time is 2h43m, and screen on 1h7m.

Battery is on 42%.

When I switch to alarms com.google.android.apps.maps Wakeups is 1002

After that, android with 139.

I'm using location history and my location is shared with my friend.

Anybody else having problem with maps battery drain ?
[BetterBatteryStats] bombadier:
In a nutshell BBS does not work on Android 14

[APP][2.2+][11 Dec. 2022 - V3.1] BetterBatteryStats

I started BetterBatteryStats because I was missing the great battery history that Spare Parts allowed to call on Froyo. It has been a long journey since the first version. BetterBatteryStats provides an insight in following categories: - General...

xdaforums.com
[BetterBatteryStats] maximus81:
On Android 14, and having issues. Is there a fix coming? Enabled all commands using adb but Battery Stats is not granted. See screenshot.
[BetterBatteryStats] bombadier:
Look at my response, 1 post above yours, there has been no statement from the developer to say what work if any is happening.
[BetterBatteryStats] maximus81:
Yeah, saw it just after posting. Any other alternative app that may work?
[BetterBatteryStats] bombadier:
[APP][2.2+][11 Dec. 2022 - V3.1] BetterBatteryStats

I started BetterBatteryStats because I was missing the great battery history that Spare Parts allowed to call on Froyo. It has been a long journey since the first version. BetterBatteryStats provides an insight in following categories: - General...

xdaforums.com

A post from a couple pages back may be of interest as an alternative
[BetterBatteryStats] maximus81:
Thanks heaps
[BetterBatteryStats] HolyDonus:
Hello everyone,

I've got a Samsung Galaxy Tab S5e running the latest LineageOS 20 firmware and I've noticed some crazy battery drainage all of a sudden in the past ~10 days.

Yesterday I watched a series for about an hour and the battery drained 15% during that time, which is unusual. I can't tell exactly how much it drained like a month ago during an hour of media consumption, but it was definitely not 15% / hour - even reading some manga with the Bubble app drained the battery surprisingly fast, about 30 mins of reading drained like 10-15% aswell :/

I didn't really do anything in the past 10 days that would justify that sudden change in battery drain - didn't install new apps, did nothing but install the LineageOS 20 updates.

Around 5 AM today, I unplugged the tablet and just let it sit until now, so I could gather some information with BetterBatteryStats.

From ~5 AM to 8 PM (= 15 hours) the battery drained a whooping 43% (2.8% / hour) :(

I uploaded the .dump-file and hope that any of you fine people can help me find the issue with the sudden battery drain or, lead me into the right direction. If some more information is needed, I am more than happy to provide it.

If anyone notices anything worth mentioning/looking into, I'd greatly appreciate it.
[BetterBatteryStats] TNSMANI:
Was your mobile signal on or off? There is no stat recorded for the mobile signal. So I don't know how much battery it consumed.

Location/scanning seems to be on. You can switch it off when not needed.

BT also seems to be on. This also can be switched off when not needed.

Apart from these, there is noting significant in the stats. My suspicion is on the mobile signal first. If your mobile signal is not great, that will drain battery. The next one is the battery itself. How old is it?