yashsingh1/xdaforums huggingface dataset:
[BetterBatteryStats] chamonix:
The current xda version works on all devices so I recommend to go ahead. If you prefer a more conservative approach with less update you can also subscribe to the gplay beta Programme (see the first posts of this thread)
[BetterBatteryStats] DiamondJohn:
Purely out of interest, by someone who does not own an S10, does that mean it would work under a permissive kernel? Yes, i understand that may be theoretical as the S10 may not have a root method as yet. I do not know.
[BetterBatteryStats] giovag7:
Ok, installed latest version from here. Seems to work on my S9+ Pie stock. To have BBS working USB debug must be always on?
[BetterBatteryStats] chamonix:
I have no way to assert that but this is my theory. Strict may be fine as well but with less agressive SELinux settings. From what I saw in the logs certain aspects of android do not even work properly on the S10 due to the overly agressive policy applied.
[BetterBatteryStats] chamonix:
Tbh I have never tested removing it after applying the permissions. Why don't you give it a try and report back?
[BetterBatteryStats] lukaszsas12:
does something like that pop up with me ??

Wysłane z mojego SM-G975F przy użyciu Tapatalka
[BetterBatteryStats] chamonix:
Yes, it is due to BBS being in compiled in debug mode
[BetterBatteryStats] Watanabe_You:
What exactly just happened here
[BetterBatteryStats] githyanki:
Interestingly enough, looks like bbs was the problem.

BetterBatteryStats version: 2.5-311
[BetterBatteryStats] lukaszsas12:
I have the same for me

Wysłane z mojego SM-G975F przy użyciu Tapatalka
[BetterBatteryStats] giovag7:
Everything seems to work fine on S9+ Pie stock no root. It is working fine even with USB debug disabled after applying the permissions the first time.
[BetterBatteryStats] akira888:
Should I be concerned about this failure?

Also should I enable Watchdog? I assume the default settings of the App would suffice under most of the situations?

The app is not working properly as yet. But I will charge it to full before confirming its non working ststus

S10 Exynos
[BetterBatteryStats] akira888:
Charged to 100%. Unplugged. Working now :) thanks OP
[BetterBatteryStats] chamonix:
BBS holds wakelock every time it needs to write a reference and this happened 8 times, with a total of a little less that an minute: I would not call that problematic. With almost an hour of screen on activity I would not draw any conclusion based on that dumpfile

Edit: typo
[BetterBatteryStats] chamonix:
This is the message that is delivered back by the battery stats service when it is stuck. Unfortunately there is no fix except rebooting
[BetterBatteryStats] githyanki:
Dump shows only 35 sec screen on time with

*job*/com.asksven.betterbatterystats_xdaedition/com.asksven.betterbatterystats.services.WriteBootReferenceService accounting for 43 minutes of awake time.

I don't know if it would be considered problematic either as overall drain was at .9%/hr so it's still good, but the numbers look off from what I normally see on a dump.
[BetterBatteryStats] chamonix:
You are absolutely right, I misread the attachement on my phone. Such a long wakelock, even if not affecting the the overall drain is problematic indeed!

Normally the wakelock is held until the database operation (write boot reference) is finished. Why this is taking so much time is the thing we need to understand.

I see different options and would like you to explore:

a) is bbs 'battery optimized'? It is not a good idea because it would cause bbs to miss some events based on android's heuristics

b) does this only affect the saving of the boot reference or does it repeat for other references like unplug or screen off? This may be interesting to understand as potentially the boot sequence is "special" related to other jobs like scanning the storage

If you could do some more testing and reporting it would be great. On my p2xl bbs wakelocks in total show for 0% of the wakelocks (no boot sequence though) but on your device it is pretty different so I would like to go to the bottom of it. A logcat may also be helpful
[BetterBatteryStats] lukaszsas12:
what is this NLP Wakelocki ??

Wysłane z mojego SM-G975F przy użyciu Tapatalka
[BetterBatteryStats] githyanki:
[MENTION=8326306]Watanabe_You[/MENTION] please see if you can get Chamonix the requested info. :good:
[BetterBatteryStats] strongst:
Network location provider.

Apps or services using your location.
[BetterBatteryStats] lukaszsas12:
even when I have a location always off ?? I never turn it on

Wysłane z mojego SM-G975F przy użyciu Tapatalka
[BetterBatteryStats] elraffa:
hi, I have too much snoozehelper.evaluate alarms and I don't have the "hide running in the background notification" app.. does anyone found any workarounds?

I'm on Android 8.1, miui 10.2.2.0 global stable, redmi note 6 pro.

Enviado desde mi Redmi Note 6 Pro mediante Tapatalk
[BetterBatteryStats] siavo:
excessuve

Thanks to the new updated BBS I finally got it to work on the S10 (exynos) . Now i charged it last night and let it rest to see what's causing the idle drain, which is a lot, 18% overnight! it even goes into deep sleep but something is off and I can't seem to figure it out. :confused: Any help? I've attached the logcat.
[BetterBatteryStats] akira888:
Strangely though, it worked perfectly this morning. But after I got home, I got this error again.

Here is my dump file.

https://www.dropbox.com/s/ept5c0o89g1fatf/BetterBatteryStats-2019-04-30_190037974.txt?dl=0

And in terms of my wakelocks, what are your thoughts? From memory I saw the music player Poweramp was on top of the partial wakelock list, which is a bit unusual?

Sorry, appears the dump file is broken. So the stat needs to be recollected..
[BetterBatteryStats] DB126:
Android and app portfolio largely performing as expected. Good signal, lots of sleep time, no runaway CPU. Nothing to explain huge dropoff. Suspect stuck/dirty sensor or failing battery.
[BetterBatteryStats] lukaszsas12:
is everything good for me, is 15% awake not too much ??
[BetterBatteryStats] Oswald Boelcke:
Unable to analyse the dump. Please refer to OP how to take a correct idle dump. Screen-on time must be less than one minute; yours is one and a half hour.
[BetterBatteryStats] siavo:
Hmm, It's been just a month since i got this new phone, i guess nothing to do other than wait for the next update, since everything was fine before the latest update pushed out by Samsung. I'll see if it's the same thing while it's in safe mode. Would a logcat during safe mode be any helpful?
[BetterBatteryStats] timbiotic:
Since upgrading BBS is crashing for me. The Google play one was stable on my s10. Using 2.5.311
[BetterBatteryStats] chamonix:
Please provide a logcat
[BetterBatteryStats] lukaszsas12:
it worked well all day and suddenly, as I wanted to see, it stopped working

Wysłane z mojego SM-G975F przy użyciu Tapatalka
[BetterBatteryStats] akira888:
Please excuse my ignorance.

I wanted to know how to take a proper dump file for you Pros to shed light on my battery drain issue.

I assume it is just not as simple as saving the dump txt file, right? If so, here is the most recent one

https://www.dropbox.com/s/q4x3cchqqqwy5k9/BetterBatteryStats-2019-05-01_121107229.txt?dl=0
[BetterBatteryStats] githyanki:
Screen on time needs to be less than 1 minute. Time covered by dump need to be over 6 hours.
[BetterBatteryStats] akira888:
Ok thx.

So basically after 6 hours of up time, the dump file needs to be saved with 1 min of me turning back on the screen? Or I can't simply turn on my screen during that 6 hours up time?
[BetterBatteryStats] m0han:
yes. no, you can't.
[BetterBatteryStats] detpruf:
Any other opinions please?

Thank you!
[BetterBatteryStats] akira888:
2nd day with BBS.

Seems it would always break midway through the day. Today I have got this msg again.

Have other S10 users experienced this issue?

Msg is: Status: Failed: Transaction failed on small parcel; remote process probably died.
[BetterBatteryStats] DiamondJohn:
Its all covered in the OP.
[BetterBatteryStats] MasterFURQAN:
My phone is getting random overnight drain of 7- 10%+ (sometimes even more). The stats and screenshots are attached below. This is with both the WiFi and mobile data turned off.

I'm on a Pocofone F1 running the latest Xiaomi MIUI EU beta 9.4.26 rooted with magisk on sphinx kernel.
[BetterBatteryStats] [Jaco69]:
I am on OnePlus 6 pie rooted device, but can not obtain root permission because BBS never ask for it. What is wrong?

Inviato dal mio ONEPLUS A6003 utilizzando Tapatalk
[BetterBatteryStats] strongst:
Try to enable root within magisk settings for BBS or reinstall BBS.

---------- Post added at 07:19 AM ---------- Previous post was at 07:14 AM ----------

0.7%/h is very good. Whatsapp and Google photos causing some wakelocks, but your device take some time to go into deep sleep and frequency is very high before deep sleep. I would try to make the same dump file with stock kernel/rom to compare it.

Not every kernel plays well with your device/setup /rom.
[BetterBatteryStats] MasterFURQAN:
Thanks. At least now I know what is causing this drain. If I disable/ freeze both these apps, I shouldn't see this drain, right ? And both these apps need internet access to work in the background. They shouldn't be causing any wakelocks if internet access is off ( both the WiFi and mobile data is off overnight). Correct me if I'm wrong.

I'll disable/ freeze both these apps this time to see if it helps. If not I'll use the stock kernel to post a new dump. Thanks again.
[BetterBatteryStats] strongst:
If you freeze both apps they will not drain, that's correct. But what's the impact of those apps on the overall drain you need to figure out.

Both apps causing wakelocks even when wifi/data is off, that's normal, cause the app needs to wake up to check the internet connection.
[BetterBatteryStats] DB126:
Opinions? Nothing notable wrt Android and app portfolio. Whatever is causing the drain is outside what BBS can 'see'. Hardware, battery or kernel fault.
[BetterBatteryStats] akira888:
Hi folks, may I just quickly confirm with you guys re doing a proper dump file.

So I think I just need to charge the phone to full, unplug, keep wifi off (as my drain mainly happens at 4G), leave it untouched for at least 6 hours. Turn on screen then do the dump within 1 min?

Thanks all!
[BetterBatteryStats] dominicstg2:
I can't get it to work it works every so often
[BetterBatteryStats] Rambdal:
Guys, I decided to buy an app in the play store. I installed and after the first day in the statistics shows a large usage in the background. What could be the reason?

Earlier I used the betterbatterystats_xdaedition_debug_2.3-248.apk version and there were no such problems
[BetterBatteryStats] strongst:
You can have a look at this and read around https://xdaforums.com/showthread.php?t=1179809&p=79432722
[BetterBatteryStats] Rambdal:
I do not really understand
[BetterBatteryStats] strongst:
Do you have similar issues within your dump file with the wakelock? Just read the suggested actions and questions from chamonix and the posts before and after the linked one.
[BetterBatteryStats] tsiftsism:
Hello,

I think i have followed the steps for sharing the dump file correctly.

I left my Nexus 7 (running custom Pie rom) at 96% battery level, and after almost 10h without touching it it lost 22%.

Can you please tell me what is causing the draining?

Thanks in advance for your answers.
[BetterBatteryStats] githyanki:
Your device never slept. Nova launcher was monitoring the accelerometer the whole time. Make sure you have double tap settings turned off in gestures settings for Nova.
[BetterBatteryStats] akira888:
Hi folks,

Here is my dump file. May I get your view on my drain

issue?

https://www.dropbox.com/s/fd8gxndai2g2623/BetterBatteryStats-2019-05-04_081906300.txt?dl=0

S10 Exynos
[BetterBatteryStats] akira888:
Did the dump file according to your instruction. Not sure whether it is normal to see wakelocks as many as like this when screen is off?

Also my main pain point is that when in my office (4g only no wifi), phone feels warm even under light use. But since I wasn't recommended to monitor battery usage under such circumstances, I don't have a dump file for my office use. Let me know if you guys need one too.

Thanks all!!
[BetterBatteryStats] DB126:
Overall fine (0.8%/hr). Blokada was biggest offender; there are better choices.
[BetterBatteryStats] akira888:
Thanks! Using Blokada based on recommendation, was told that it's battery consumptions is very minimal?!
[BetterBatteryStats] Oswald Boelcke:
As your device is not rooted and you can't access/modify the hosts file, ads and tracking blocking is only possible via VPN tunneling as Blokada does with all its pros and cons. The VPN tunnel certainly doesn't use too much but it uses power.
[BetterBatteryStats] DB126:
FWIW - I use AdGuard on both rooted/unrooted devices and desktop browsers via extension. Effective, refined with minimal power signature. Have no idea if it sends telemetry (metadata) back to developer...nor do I care.
[BetterBatteryStats] Oswald Boelcke:
Certainly a good recommendation. Due to my OpenVPN requirement I'm unable to use any other application that uses VPN. I think NetGuard by Marcel Bokhorst (M66B) isn't not only a well recognised firewall (and also working on unrooted devices) but should also well block ads and trackers.
[BetterBatteryStats] DB126:
Agree on NetGuard (reputation) if one wishes to go that route. Firewall primary with ad blocking possible. FWs tend to be more difficult to administer vs VPN based ad blockers which generally focus on ease of use; FW capability comes along for the ride. Nice to have choices!
[BetterBatteryStats] 7ewis:
Quick question, I'm running Android Pie and just wondering if I can disable the notifications without breaking anything?

I've read Android can kill apps if you disable the persistent notification. I've been having issues with AdGuard and am wondering if it's because I turned that notification off.
[BetterBatteryStats] chamonix:
Yes you can. I have put the required notification into a separate channel so you can disable it if it bugs you: no other vital notification will be send to that channel
[BetterBatteryStats] chamonix:
New build will be up in a few with fixes from crash analytics. This seems to be a good candidate for gplay beta
[BetterBatteryStats] dagrim1:
A tip for those who also suffer from the "Failed: Transaction failed on small parcel" error...

For me a reboot didn;t work, nor wiping the applications data or uninstalling/reinstalling. But after wiping the phone's cache (from the recovery menu) it DOES seem to work again...

Exynos S10+ version, now on to figuring out what's causing my phone to be awake so often... I suspect it's the sd card so now copying the pictures on it and removing it.

*Edit*

And the error comes back again, unfortunately makes the app not really usable atm...
[BetterBatteryStats] drezz2:
can someone please tell me if you see something weird? It is not a long time but I have noticed that when I activate the gps, even if I do not use it, the device is left in the "awake" state for a long time even though I leave it on the table without doing anything.

I've looked at the logs, but I have not seen anything weird, is there something weird? or maybe it's the bbs version that I'm using?

the dmesg file, have some "read system status fail" dont know if its important?

the file "BetterBatteryStats-2019-05-06_214334153.txt" have the first 15m awake (i think), after go to sleep.have 11m in 300mhz and after deep sleep

the file "BetterBatteryStats-2019-05-06_220446698.txt" its only 18m, but almost all time.. awake

just after removing the gps, this always happens to me when I put gps on and then when I put off, it would help me if someone sees something weird

thanks, again
[BetterBatteryStats] DiamondJohn:
I have not looked at your logs, but Doze settings / config include specific settings to control how log to wait before going into a lower state such as light idle or deep idle. Try running

su;
dumpsys deviceidle;

The first thing it shows is your idle config, including the "inactive timeout" it waits before attempting to going into idle. And I think another setting also includes a time out regarding position and accuracy, before going into idle.
[BetterBatteryStats] drezz2:
I did not know it, it actually indicates the accuracy and time .. I think this means

accuracy 20 meters ¿its the gps accuracy? and time 30 seconds? would not explain then that other time that I have previously put

there are others that I do not understand as idle_after_inactive_to = + 30m0s0ms
[BetterBatteryStats] patrickdrd:
has anyone downloaded the new version from apkmirror?

https://www.apkmirror.com/apk/sven-knispel/betterbatterystats/betterbatterystats-2-5-314-release/

is this a beta?

I downloaded it a couple of days ago, but just saw that the stats got reset,

without any particular reason, I mean my device wasn't rebooted or anything,

any information on this version?
[BetterBatteryStats] PiCkLeS:
How about you install Hockey and download that way and also see changelogs.

/P
[BetterBatteryStats] patrickdrd:
no buddy, I'm against of such practices, let's say I've got 100 apps, would I need another 100 apps as updaters for them, no, definitely no

what's wrong with apkmirror and play store anyway?

after all I know the changelog already, Android 9 fixes, too bad it's irrelevant for me because I'm on nougat and I'll be for a while to come
[BetterBatteryStats] chamonix:
I do not maintain that source so I can not say anything about it nor if it the "same" version as the one I publish.
[BetterBatteryStats] :
Hi i have tried playstore version and executed the commands and tried over 10 times. it doesn't seems to be working on S10+. any help would be appreciated please

I tried these following command

adb shell

pm grant com.asksven.betterbatterystats android.permission.BATTERY_STATS

pm grant com.asksven.betterbatterystats android.permission.DUMP

pm grant com.asksven.betterbatterystats android.permission.PACKAGE_USAGE_STATS
[BetterBatteryStats] nagyra:
Hello guys!

I have a battery draining problem with a Xiaomi Mi 9 SE phone (Android Pie, MIUI Global 10.2.5.0). As you can see on screenshots, the phone discharged by 33% in 10,5 hours. That wouldn't be interesting, but the screen on time only 29min!

I tested the phone for a few day, and at the evening usually remains only 20-30% battery with 1,5h sot.

Do you have an idea what could be the problem?
[BetterBatteryStats] strongst:
Can you please attach a dump file(see instructions) instead of screenshots?
[BetterBatteryStats] DB126:
APKMirror is a great resource. That said, uploads are generally not not posted by product owners and may be backdated or unsupported. Go 'official' if you want the latest builds, a shiney change log and/or community support. For this project the developer opts to use HockeyApp for evolving builds.

---------- Post added at 12:12 PM ---------- Previous post was at 12:08 PM ----------

Yep, Play Store release doesn't (yet) support S10+. Development builds do.
[BetterBatteryStats] Ryan1469:
Even development builds are not working properly for the S10 plus. It keeps breaking in between with the transaction failed on small parcel error.
[BetterBatteryStats] nagyra:
Yes, sure :D Today was a better day than the last few, now remained 37% battery (since charged up 16.5h ago, with 2.5h screen on time). But I think it's even not so good.

What is your opinion?
[BetterBatteryStats] strongst:
Sorry, but you have screen on time more then only some seconds like described in the instructions in the first post.

It's not very useful to investigate usage dumps,so you should provide an idle dump.
[BetterBatteryStats] chamonix:
Unfortunately that is Samsung's fault: I had to fall back to the old way of Retrieving stats that is known for that issue of the battery info service stopping to work. Atm I have no better workaround and still hope tsht samsung will fix the too restrictive selinux policy in regards to reading parcels using streams.
[BetterBatteryStats] vingia:
What is wacthdog and how enable it?
[BetterBatteryStats] strongst:
Please read the FAQ first https://xdaforums.com/showthread.php?t=1179809&p=15869904 you can enable it in BBS settings.
[BetterBatteryStats] vingia:
Thank you. I do not have a xda version, is this function in playstore version? I do not get "screen off" reference.

Update: I found it. Can anyone explain me how configure for find why Frost drain my battery when in use?
[BetterBatteryStats] ianmacd:
If you can supply the more liberal SELinux policy that would fix BBS for the S10 series, I'd be happy to put together a Magisk module that dynamically injected it at boot. If that's all we need to have BBS on these devices, let's please not wait for Samsung.
[BetterBatteryStats] Nekromantik:
I'm seeing different hourly drain percentage on different apps and it seems to randomly reset hourly stat to nothing. Attached dump. Any one can check? Thanks
[BetterBatteryStats] DB126:
Not an idle dump; read OP and repost.
[BetterBatteryStats] Nekromantik:
ok
[BetterBatteryStats] chamonix:
Well as a matter of fact I can not as I don't know enough about selinux to read through all differences between stock android pie and the one put together by Samsung. The only thing I can tell after reading the source code is that a stream parcel (how it should be) requires file read access. I can try to find out where these "files" are located by debugging if it helps.
[BetterBatteryStats] chamonix:
That may be a good idea btw. Is there root on the S10 already and can someone try to apply the permissive selinux policy and check on the permissions screen of BBS to see if bbs still falls back or uses native mode with other policies applied?
[BetterBatteryStats] ianmacd:
If you can paste a log line containing an access denial here, I can take it from there. Or I can find it for myself, I guess, if the error is obvious.
[BetterBatteryStats] deloj:
Hi everyone,

I have the Nexus 9 and am running ElementalX kernel with Lineageos 15.1 (oreo). When the tablet sleeps it drains 1 - 2% in battery an hour. Overnight it drains 12% - 14% in battery. I've tried apps to shut down wakelocks like naptime. But they dont help.

Is there a log from BBS I can upload here for all of you to review? Where in BBS can I find it??
[BetterBatteryStats] DiamondJohn:
As requested above, the denials will be explicitly stated in a logcat. A little better would be to run permissive and get a logcat, because if you run enforcing, the first denial may stop the app doing the next step and thus miss the next denial. Running permissive will still log all selinux denials, but allow them.

I have historical built ROMs and part of that process was coding SELinux. As such I scripted something up to0 generate simple selinux allow statements, and its included in the following app

https://xdaforums.com/android/apps-games/app-temefi-comprehensive-documentation-t3806260

You can find it within the menu at Logcat>Logcats>Generate SELinux Allows

Or you can simply view the denials using Logcat>Logcats>Logcat - SELinux
[BetterBatteryStats] strongst:
I highly recommend to read at least the first post to know how to provide a log :)
[BetterBatteryStats] deloj:
Will do.. I'll post the log soon.

---------- Post added at 08:19 AM ---------- Previous post was at 07:29 AM ----------

I'm confused by the 1st post on how to produce a dump file. The op states, "adjust from/to references to 'screen off' and 'screen on'." What does this mean exactly??
[BetterBatteryStats] Oswald Boelcke:
After your device had rested untouched by you for at least six hours, when you launch BBS it most likely shows "Unplugged" and "Current". Click on the downwards pointing triangles right beside the two words to set "unplugged" to "screen off" and "Current" to "screen on".
[BetterBatteryStats] deloj:
Ok I finally produced 3 dumpfiles.. current, screen on and screen off. Let me know what you guys think..
[BetterBatteryStats] githyanki:
All 3 have too much screen on time. Needs to be less than 1 minute screen on time.
[BetterBatteryStats] deloj:
Too much screen on time? That makes no sense.

So how do I make that possible?