yashsingh1/xdaforums huggingface dataset:
[BetterBatteryStats] TNSMANI:
As @Oswald Boelcke said earlier, the main villain in your case is the mobile signal. You had poor signal most of the time, moderate signal for less than hour and even no signal for some time. With this scenario, you don't need to look beyond the mobile signal to achieve what you want. If in doubt, choose a place where the signal is good (if possible) and take another dump with the same settings and see for yourself.

Yes, there are multiple other wakelocks, alarms etc but we don't know how much of that is triggered by the poor signal. You have to first eliminate that and save another dump file so that we can see which other components are contributing to the drain.

Shutting off receivers and senders indiscriminately may result in a brick, so be careful with that.

You have the GPS wakelocks which are triggered by an app that is triggering them. If you can find such an app, freeze it or control the number of times it triggers GPS, if possible.

I don't know what this is. If you know the app that is causing this, take remedial action.

Facebook/Instagram too are causing a lot of alarms.

You know the cause of these.

The other alarms and wakelocks are mostly related to your mobile signal issue except for the location wakelocks and alarms. Only you know your setup, so find out which apps are asking for GPS/location data or where you have them enabled and act accordingly.
[BetterBatteryStats] Schroeder09:
I hope you mean soft brick! I've blocked trackers on Google play services, Google, carrier services, and third party apps.

Adaptive connectivity service, android setup, android system intelligence, cbrsnetwork manager, companion device manager, fused location, Google's Google play services, imservice, settings services, shell, and tasker are the only apps that have access to location at all times. Of these only tasker and Google are the only user apps. All the rest are system apps, and to the best of my knowledge need to be left with unrestricted access to location. If I can restrict any of them to only having location while I use the app please let me know.

I've blocked the wakelocks for these apps. That greatly helped with their wakeups. How do I stop the alarms?

You said I should know what these wakelocks are but I don't:

Sensor: Proximity Gated Single Tap Gesture (wake-up)(16842783), wakeup=true, Time: 5 h 14 m 47 s

Sensor: Quick Pickup Sensor (wake-up)(16842785), wakeup=true, Time: 5 h 14 m 52 s

(org.cleanslate.csservice.CleanSlateService): Sensor: TMD3719 Proximity (wake-up)(16842759), wakeup=true, Time: 5 h 9 m 58 s

There is no single tap to wake action in the cleanslateapp
[BetterBatteryStats] TNSMANI:
As I said earlier, eliminate/reduce the drain from the mobile signal issue first and save another dump file. Otherwise, we are fishing in the dark. I don't want to offer any advice based on the current dump file other than this as I am not certain what causes which issue.
[BetterBatteryStats] chamonix:
Unfortunately my S10 on A12 does not have the latest Samsung issue so I am flying blind.

New build is on its way. Don't expect any fix yet: I have added more diagnostics and a little trickery. If you have a Samsung Device on A13 please run the diagnostics and post your resuts
[BetterBatteryStats] _theluk_:
I would like to support. However, after granting permissions, the app crashes and I have no possibility to use any feature of the app. Will diagnostics be possible without granting permissions?
[BetterBatteryStats] dagrim1:
Same here, it crashes specifically after granting BATTERY_STATS permission through adb...

The other permissions (and hidden_api_policy) are ok, it keeps working, but after granting BATTERY_STATS permision it crashes right after launch.
[BetterBatteryStats] chamonix:
any chance you could send me a logcat?
[BetterBatteryStats] shaggyskunk:
Is there a log app that works reliably on One UI V5.0 (Android 13)?

I'm away from my laptop, and I've tried Logcat Extreme & Matlog - But neither of them are cooperative at the moment?

Do you mind if I send you a PM? There's another app exhibiting very similar behaviour to BBS.. It might give you some insight - or not?
[BetterBatteryStats] _theluk_:
Sure. Any preferences or just default output?
[BetterBatteryStats] _theluk_:
Attached is a logcat where I tried to filter as much as possible (I'm certainly not an expert on that topic - so please let me know if something else is needed; ideally including the respective command line prompt). Before granting permissions to BBS I had enabled the option to include debug info in BBS settings in case that helps
[BetterBatteryStats] dagrim1:
Weirdly enough it now doesn't seem to crash anymore? (Did one more time when going into settings, but now seems ok).

Still no stats except for cpu states and alarms though (and still the "inconsistent tx state lengths" msg) but assume that is expected.

V3.3.504 on the s22 ultra with oneui5/android13

*Edit* Also logcat attached, including what I assume are the issues wrt getting the proper stats with piecies like the following:

12-29 07:51:09.462 I/BatteryStatsProxy(20109): Read 3496616 bytes at 0 of avail 3496616
12-29 07:51:09.462 I/BatteryStatsProxy(20109): Read 0 bytes at 3496616 of avail 3496616
12-29 07:51:09.462 I/BatteryStatsProxy(20109): **** FINISHED READING: pos=3496616 len=3496616
12-29 07:51:09.465 E/BatteryStatsProxy(20109): An exception occured in BatteryStatsProxy(). Message: inconsistent tx state lengths
12-29 07:51:09.465 D/BatteryStatsProxy(20109): getWakelockStats was called with params [iStatType] = 1
12-29 07:51:09.465 E/StatsProvider(20109): An exception occured processing kernel wakelocks. Message: null
12-29 07:51:09.465 E/StatsProvider(20109): Exception: com.asksven.android.common.privateapiproxies.BatteryInfoUnavailableException
12-29 07:51:09.465 E/StatsProvider(20109): at com.asksven.android.common.privateapiproxies.BatteryStatsProxy.computeBatteryRealtime(BatteryStatsProxy.java:699)
12-29 07:51:09.465 E/StatsProvider(20109): at com.asksven.android.common.privateapiproxies.BatteryStatsProxy.getKernelWakelockStats(BatteryStatsProxy.java:2825)
12-29 07:51:09.465 E/StatsProvider(20109): at com.asksven.betterbatterystats.data.StatsProvider.getCurrentKernelWakelockStatList(StatsProvider.java:1193)
12-29 07:51:09.465 E/StatsProvider(20109): at com.asksven.betterbatterystats.data.StatsProvider.populateReference(StatsProvider.java:2623)
12-29 07:51:09.465 E/StatsProvider(20109): at com.asksven.betterbatterystats.data.StatsProvider.setCurrentReference(StatsProvider.java:2494)
12-29 07:51:09.465 E/StatsProvider(20109): at com.asksven.betterbatterystats.StatsActivity$LoadStatData.doInBackground(StatsActivity.java:920)
12-29 07:51:09.465 E/StatsProvider(20109): at com.asksven.betterbatterystats.StatsActivity$LoadStatData.doInBackground(StatsActivity.java:909)
12-29 07:51:09.465 E/StatsProvider(20109): at android.os.AsyncTask$3.call(AsyncTask.java:394)
12-29 07:51:09.465 E/StatsProvider(20109): at java.util.concurrent.FutureTask.run(FutureTask.java:264)
12-29 07:51:09.465 E/StatsProvider(20109): at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:305)
12-29 07:51:09.465 E/StatsProvider(20109): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1137)
12-29 07:51:09.465 E/StatsProvider(20109): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:637)
12-29 07:51:09.465 E/StatsProvider(20109): at java.lang.Thread.run(Thread.java:1012)
[BetterBatteryStats] _theluk_:
Can confirm this behavior. For whatever reason the app no longer crashes on launch. Here's a diagnostics output that hopefully helps to bring back all stats:

Build.VERSION.RELEASE: 13
Build.BRAND: samsung
Build.DEVICE: b0s
Build.MANUFACTURERsamsung
Build.MODEL: SM-S908B
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
ParcelFormatException occured
batteryStatsImpl_CREATOR.createFromParcel FAILED, trying readFrmParcel with PowerProfile set
FAILURE: an unhandled exception occured

STACK TRACE
java.lang.reflect.InvocationTargetException
at java.lang.reflect.Method.invoke(Native Method)
at com.asksven.betterbatterystats.DiagnosticsActivity.diagGetService(DiagnosticsActivity.java:329)
at com.asksven.betterbatterystats.DiagnosticsActivity.onResume(DiagnosticsActivity.java:95)
at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1531)
at android.app.Activity.performResume(Activity.java:8721)
at android.app.ActivityThread.performResumeActivity(ActivityThread.java:5338)
at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:5431)
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:2571)
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:8741)
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)
Caused by: android.os.ParcelFormatException: inconsistent tx state lengths
at com.android.internal.os.BatteryStatsImpl$ModemTxRxCounterImpl.<init>(BatteryStatsImpl.java:4309)
at com.android.internal.os.BatteryStatsImpl$ModemActivityCounterImpl.<init>(BatteryStatsImpl.java:4420)
at com.android.internal.os.BatteryStatsImpl.readFromParcelLocked(BatteryStatsImpl.java:21430)
at com.android.internal.os.BatteryStatsImpl.readFromParcel(BatteryStatsImpl.java:21271)
... 19 more
[BetterBatteryStats] Schroeder09:
Just firing up a new pixel 7 pro. I am rooted with magisk 25.2. BBS is installed as a system app. I check the permissions and they're all granted according to the permissions checker in the app settings. Yet BBS has the yellow banner stating "no stats have been collected yet." The app and phone have been up and running for hours. I'd think it'd have something by now.

EDIT: I should note this is on the summary page only. There are stats under the kernel wakelocks, alarms, and cpu states menus.
[BetterBatteryStats] Lughnasadh:
What version are you using? 3.3-504 installed as a user app running stable Magisk 25.2 is working fine on my Pixel 7 Pro running QPR2 Beta 1 (also working on stable QPR1 December build).
[BetterBatteryStats] Schroeder09:
It's installed as a system app. It's version 3.0-485. I just had it working on my first p7p. When restored from swift backup to the new p7p on December update it doesn't have a summary.
[BetterBatteryStats] Lughnasadh:
Update the app.
[BetterBatteryStats] Schroeder09:
Updated and I still have the same results. Very odd. Anyone have any recommendations? Should I uninstall and reinstall? It says it has all the permissions, and it looks like it is collecting data. Is empty. Obviously that's pretty important, and I'm sure we all use it heavily when looking at this app.
[BetterBatteryStats] Lughnasadh:
Yes, try uninstalling and reinstalling. It doesn't need to be installed as a system app. Try using the latest version in App Center.
[BetterBatteryStats] chamonix:
Unfortunately I can't seem to find any cause for a crash of bbs in the log. Anyone else who can reproduce?

It seems Samsung has not implemented A13 fully. Fortunately it looks like I will get my hands on a lender S20 next week so we may see some progress
[BetterBatteryStats] chamonix:
Don't install as a system app, this has stopped being relevant years ago.

And please check the raw stats: it's the best way to seeing what is collected and what not. And please post a dumpfile since we don't know what device you are on / if you suffer from Samsung being unable to support android properly
[BetterBatteryStats] Schroeder09:
App center? What's that? How do I not install as a system app?
[BetterBatteryStats] Lughnasadh:
See the OP, Post #2 where it says "Get release candidates here."

How do you not install it as a system app? Just install it like you would any other app.
[BetterBatteryStats] shaggyskunk:
Just use adb commands for BBS.

I've never installed BBS as a system app - Even when I had Root.
[BetterBatteryStats] Thebear j koss:
From his log. Layout preferences binary xml 10
[BetterBatteryStats] Lughnasadh:
I actually wasn't asking the question. The person I was replying to asked how to not install it as a system app. I told them earlier they didn't need to do that. Just install it as a user app. I was just repeating that question as if I couldn't understand why they were asking that.

All you need to do is install it with a file manager.
[BetterBatteryStats] DSF:
Hi!

Any idea what's AWakeLock that doesn't let my pixel 7 pro go to deep sleep?

Thx!
[BetterBatteryStats] TNSMANI:
A screenshot of the Partial Wakelocks is not enough. Please read the first page of this thread and attach an idle dump file as required.
[BetterBatteryStats] chamonix:
TLDR;

If you have a samsung phone on A13 I need you to test something and give me feedack.

a) download the build 3.3.1-514 (107)

b) manually grant the permission: adb -d shell pm grant com.asksven.betterbatterystats_xdaedition android.permission.READ_PRECISE_PHONE_STATE

c) call the diagnostics screen and share the result/effect

Long version ;)

I did some reading of the android source code. What is interesting is that both com.android.internal.os.BatteryStatsImpl$ModemActivityCounterImpl and com.android.internal.os.BatteryStatsImpl$ModemTxRxCounterImpl are classes that are not in the android 13 release branch: https://android.googlesource.com/pl...com/android/internal/os/BatteryStatsImpl.java

So I am on a hunch here but my guess is that there are some permissions that prevent the model tx/rx data from being read; there was a similar issue with bluetooth stats a few years ago. So I did some reading about permissions introduced with Android 13 an I found one that could (this is a wild guess at best) be related.

Long story short I have blindly added some permissions to the manifest:

<!-- Attempt to narrow down the A13 Samsung issue -->
<uses-permission android:name="android.permission.READ_BASIC_PHONE_STATE" />
<uses-permission android:name="android.permission.READ_PRECISE_PHONE_STATE"
tools:ignore="ProtectedPermissions" />

Who has the Samsung issue with A13 and is ready to:

a) download the build 3.3.1-514 (107)

b) manually grant the permission: adb -d shell pm grant com.asksven.betterbatterystats_xdaedition android.permission.READ_PRECISE_PHONE_STATE

c) call the diagnostics screen and share the result/effect

Happy new year to you and your loved ones!
[BetterBatteryStats] Oswald Boelcke:
Same to you! Thanks for all your efforts to the benefits of the XDA users.

"Ich wünsche einen guten Rutsch" - or translated for all XDA users a Happy New Year!
[BetterBatteryStats] _theluk_:
I'm more than welcome to help. However, irrespective of whether I grant the other permissions beforehand or not, it appears the permission cannot be granted:

C:\Program Files (x86)\Minimal ADB and Fastboot>adb -d shell pm grant com.asksven.betterbatterystats_xdaedition android.permission.READ_PRECISE_PHONE_STATE

Exception occurred while executing 'grant':
java.lang.SecurityException: Permission android.permission.READ_PRECISE_PHONE_STATE requested by com.asksven.betterbatterystats_xdaedition is not a changeable permission type
at com.android.server.pm.permission.PermissionManagerServiceImpl.grantRuntimePermissionInternal(PermissionManagerServiceImpl.java:1437)
at com.android.server.pm.permission.PermissionManagerServiceImpl.grantRuntimePermission(PermissionManagerServiceImpl.java:1364)
at com.android.server.pm.permission.PermissionManagerService.grantRuntimePermission(PermissionManagerService.java:553)
at android.permission.PermissionManager.grantRuntimePermission(PermissionManager.java:599)
at com.android.server.pm.PackageManagerShellCommand.runGrantRevokePermission(PackageManagerShellCommand.java:2593)
at com.android.server.pm.PackageManagerShellCommand.onCommand(PackageManagerShellCommand.java:305)
at com.android.modules.utils.BasicShellCommandHandler.exec(BasicShellCommandHandler.java:97)
at android.os.ShellCommand.exec(ShellCommand.java:38)
at com.android.server.pm.PackageManagerService$IPackageManagerImpl.onShellCommand(PackageManagerService.java:6978)
at android.os.Binder.shellCommand(Binder.java:1085)
at android.os.Binder.onTransact(Binder.java:903)
at android.content.pm.IPackageManager$Stub.onTransact(IPackageManager.java:4962)
at com.android.server.pm.PackageManagerService$IPackageManagerImpl.onTransact(PackageManagerService.java:6962)
at android.os.Binder.execTransactInternal(Binder.java:1321)
at android.os.Binder.execTransact(Binder.java:1280)

Thank you so much for looking into this! Wishing you and all others a great start into 2023!

Edit: Removed question about other permissions and updated reply accordingly.
[BetterBatteryStats] chamonix:
Thanks for your feedback. Hopefully I will get some progress once I have a lender in my hands.

And thx for the wishes! All the best to you too
[BetterBatteryStats] paulr24:
Sorry for the late response, it's the xdaedition version
[BetterBatteryStats] Rinoceros:
Hi all,

Happy new year to everybody.

I have been a long time not active on this forum, but will get this again.

I have been used BBS on my rooted devices, but after switching to my current device, I didn't had the need to root my device again.

But for now, I have noticed that some software can be used on non-rooted devices as well, as like this BBS software.

So I have installed it on my current device: a OnePlus 8pro running Android 13.

The BBS software is the 3.3.1-514 xda edition.

When I choose to select Partial Wakelocks, BBS crashes instantly

By choosing Process and I scroll down, the app crashes.

It didn't it in the previous versions.

BBS has all the rights and permissions.

What am I doing wrong?

Build.VERSION.RELEASE: 13
Build.BRAND: OnePlus
Build.DEVICE: OnePlus8Pro
Build.MANUFACTUREROnePlus
Build.MODEL: IN2023
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
NullPointerException occured
batteryStatsImpl_CREATOR.createFromParcel FAILED, trying readFrmParcel with PowerProfile set
SUCCESS
[BetterBatteryStats] ballmead:
Since upgrading to ICS 4.0.3 on my SG2 I have this huge partial wakelock.

Does anyone know what's causing this?

*sync*_com.android.browser_Account{name=myemailaddress@gmail.com, type=com.google}
[BetterBatteryStats] cdmackay:
Thanks... sorry to be dense, but what's the difference between wifi ON and RUNNING?

Is Running "connected", and On "disconnected"?

thanks much...
[BetterBatteryStats] chamonix:
On = Wifi enabled

Running = Wifi connected
[BetterBatteryStats] brchickery:
Help?

Galaxy nexus, fresh install of newest axiom crack build.

I'm not complaining I get ok battery. But unfortunately I cant sit by and listen to people say they have 4+ hours of onscreen time and loose only 1% battery an hour. I have never seen anything even close to that....

Can someone analyze this log for me and or gimme some info on what to look for?

I use, 4g, exchange push email, almost no on screen time. Hotplug enabled. Franco kernel. Stock UV values. I have the extended battery. I barely even use my phone and sometimes I just loose battery like it's going out of style. 5-7% an hour.

Is this all because of my service? Is my low service just draining battery like mad?

I feel like my wake locks are low but I'm not sure what else I can check on or check into... I have tried every rom/kernel combo and get almost exact same results with all of them.

Thanks so much for the help guys.

16 minutes 49 seconds of on screen time for these shots.

http://dl.dropbox.com/u/13108/BetterBatteryStats_History-2012-03-15_105643346.txt
[BetterBatteryStats] chamonix:
Could you please post a logcat
[BetterBatteryStats] GoJo ^^:
whats weird is that on the widget it shows the right %/hour! So why not in the app...?
[BetterBatteryStats] sp8y:
Hi chamonix,

Yes no problem here is the logcat running for the last 8 hours or so although it is quite a large as I wasn't sure what exactly to look for. I've only deleted some info like wifi ssid & mac address.

Thanks for your help.
[BetterBatteryStats] chamonix:
I see getWifiOnTime being called (Wifi ON) but not getGlobalWifiRunningTime: that would explain that value not being shown. What version are you using?
[BetterBatteryStats] sp8y:
Version of BBS?

It's the latest one from today.

---------- Post added at 09:25 PM ---------- Previous post was at 09:09 PM ----------

Just to add the "wifi running" is now showing up on my sons Atrix on 2.3 gingerbread.

I've reinstalled bbs but still no joy on my Defy with 2.2 froyo.

Not sure if it makes any difference but my wifi sleep policy is set to "when screen is off" & I have also reduced the default Android sleep timeout from 15 minutes down to 5 seconds.
[BetterBatteryStats] sohebq:
A request to chamonix

You are doing great job as usual. However, I want to make a request.

I saw a lot of dumps and realized that there are many common issues or services that causes wakelocks. Is it possible for you to make a list of all the common "partial wakelocks" along with their reason and add it to the first page. This will save a lot of time for future. Like, rather than telling people about what is causing problem in their phone, just refer them to the first page so they can see it by them selves. I hope you understand what I mean.

Look here http://xdaforums.com/showthread.php?t=1351663. The OP of this thread did the same with All the apps in Titanium backup. Can you do the same for your app ?
[BetterBatteryStats] ballmead:
I have sync turned off.

Gmail, Talk, Google + have all been uninstalled but still get this account based wakelock.

Any ideas?
[BetterBatteryStats] N00BGuy:
Hi Guys

I have a I9000 running ics, I have a problem with the screen flashing on several times a day, sometimes every 15 minutes to once an hour. I have disabled sync, location, JD, and anything else I could think of, but the problem is still here. The battery drop overnight is ~1% per hour, which is good for me, but the screen is still flashing on. If I could find out whats causing this, maybe I could turn on some of the features and still have good battery life.

This is a dump of ~7 1/2 hours overnight. Thanks in advance for all your help!
[BetterBatteryStats] jeremysherriff:
@chamonix I switched ROM and kernel to a .32 kernel (was .35) and i now get a wifi running counter..
[BetterBatteryStats] jeremysherriff:
Don't uninstall google framework apps like talk and gmail, you'll have issues.

Make sure the option to back up to google has been turned off. Do you use any options like market notifications on app upgrades, or syncing ebooks?

Edit - can you post a log? This is difficult without context.
[BetterBatteryStats] Braneless:
I always delete the Talk and google+ apks after flashing a new rom. Never had an issue and my awake time barely exceeds screen on time.
[BetterBatteryStats] chamonix:
The wifi running / on info comes from userland. I wouldn't expect a kernel to break that except if there was something seriously wrong with it.
[BetterBatteryStats] jeremysherriff:
O ok. In that case i was on a kang'd ics build (aurora) and have moved to a cm7.2 port. I'm guessing that doesn't help you though!