yashsingh1/xdaforums huggingface dataset:
[BetterBatteryStats] NickosD:
That's overnight. Samsung significant sensor was used for 4 hours by GPS

And dunno, I might be overreacting. 7% in 8 hours can be both good and bad I guess
[BetterBatteryStats] GeNiO790:
I think it's a BBS problem because even now after rebooting it gives me:

"Statistic Type: Unplugged to Current

Since 0 s "

And it was disconnected from the current for at least 5 hours....

I don't have root on my redmi note 5 and I had BBS installed a long time ago, do I have to reinstall it? Or should I give him other permissions ??
[BetterBatteryStats] DiamondJohn:
Not BBS specific, but whenever an app just doesnt seem to work, things to try in general are wipe the data & cache for the app, uninstall and reinstall the app then try to wipe the devices dalvik and cache.

Oh, and a logcat can sometimes help.
[BetterBatteryStats] DB126:
Not really surprising for a stock S10+ loaded up with sensors and always running apps that you probably don't need. That said:

- 21 min of 'wake' time over 7½ hours is reasonable

- radio signal was poor during sampling window which was likely a prime contributor to elevated drain rate

- active social media (Facebook) and weather apps don't help the cause
[BetterBatteryStats] GeNiO790:
Do you want me to attach a logcat to you right away?
[BetterBatteryStats] pjadec:
Rooted or no rooted phone?

When you installed bbs, did you give it those permissions what are required.
[BetterBatteryStats] GeNiO790:
Smartphone without root. By installing it I had given him all the necessary permits. I had already made a dump attached right here.

After installing it I also did an update. I don't know if it can be a problem...
[BetterBatteryStats] pjadec:
Adb commands also? Without those adb commands bbs doesn't work right.

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

Just checking
[BetterBatteryStats] Vovodroid:
Hi,

I installed developer version 2.5-337 on Resurrection Remix Marshmallow 5.7.4 on Galaxy S3 I9300 (with root enabled, of course). But BBS couldn't get APPOPS_USAGE_STATS permission. When I press green OK button I enter "Apps with usage access" page, but BBS isn't present here.

I'm ready to fully participate with problem solving - logs, debug, whatever needed.

Thanks
[BetterBatteryStats] GeNiO790:
Yes, I gave them the adb commands. also because before, BBS worked well. What do I do, try to give it back the adb commands? maybe some updates did some damage...
[BetterBatteryStats] NickosD:
Just unistall it, reboot, download the latest test version (337), give again adb and do overnight a dump
[BetterBatteryStats] Vovodroid:
Adb doesn't know this permission. It seems to be a problem with custom ROM:

https://accubattery.zendesk.com/hc/en-us/articles/211909245-Unable-to-grant-usage-stats-permission
[BetterBatteryStats] GeNiO790:
Where is the test version (337)??
[BetterBatteryStats] Vovodroid:
See second post in the thread.
[BetterBatteryStats] Vovodroid:
Solved with https://xdaforums.com/android/help/guide-workaround-apps-access-to-usage-t3535705
[BetterBatteryStats] GeNiO790:
Is this answer for me?
[BetterBatteryStats] Vovodroid:
No, it's solution for my problem. For you is answer
[BetterBatteryStats] ninestarkoko:
Hello, are there any news about this problem for us S10s users?
[BetterBatteryStats] chamonix:
None that I don't know of and I have no idea for a better fix. Wait for android 10 ans see if Samsung fixes their bug I the only option that I see
[BetterBatteryStats] Vovodroid:
By a way, shouldn't BBS set all needed permissions on rooted device by itself? :confused:
[BetterBatteryStats] DiamondJohn:
Under the latest versions of Android, the app should request the permission on startup. but the user has to consciously / physically allow the requested permission. So if the user accidentally disallows a permission on the first start, they will not be asked again, and the permission will not be allowed.

These permission do not apply to root actions. If root is allowed, then actions specifically run using root, do not need permissions. Just because an app is rooted, does not mean that it performs every action using root, only those explicitly coded for root by the dev.
[BetterBatteryStats] Vovodroid:
Sure. But I guess on first launch BBS says that on rooted device it enables permissions.
[BetterBatteryStats] DiamondJohn:
Its possible that BBS uses root to enable the permissions behind the scene.
[BetterBatteryStats] ninestarkoko:
Oh, that's a pity...but by android 10 i'll probably be rooted.:laugh:

Thanks anyway for the struggle.
[BetterBatteryStats] chamonix:
It is sad indeed but for samsung there is indeed no option to root except if the workaround is stable enough
[BetterBatteryStats] mgrzyb16:
log analysis

Hi guys, can someone please look into my BBS data dump (attached to post) and screenshots? It's a joke, my SOT is usually less than 2 hours :< (OP6 here).

BBS Screenshots here:

https://imgur.com/a/QyvOQOW

https://imgur.com/a/dOIChfJ

https://imgur.com/a/5Jl6wOs

Any ideas?
[BetterBatteryStats] githyanki:
Your dump has 21 minutes of screen on time, phrase do it again with less than one minute SOT.
[BetterBatteryStats] MKchrias:
Does BBS work with Samsung Note 10+?
[BetterBatteryStats] NickosD:
Test it and report. If it's like S10, it might work until 70-60%. Alarms are visible even below that.
[BetterBatteryStats] MKchrias:
Doesn't seem to work. I ran adb comands anf get the following
[BetterBatteryStats] MKchrias:
Found log files
[BetterBatteryStats] githyanki:
Since 24 m 24 s

You need a log that covers 6 hours with less than a minute of SOT.
[BetterBatteryStats] MKchrias:
Ok thank you
[BetterBatteryStats] MKchrias:
Have run overnight still seem to have a problem.
[BetterBatteryStats] pjadec:
You use old version of BBS app

Newest version BBS app

betterbatterystats_xdaedition_debug_2.5-337.apk
[BetterBatteryStats] MKchrias:
Used app from play store, where do i get new one from please?
[BetterBatteryStats] Vovodroid:
See second post in this thread.
[BetterBatteryStats] GeNiO790:
I reinstalled BBS, used the version that you gave me, but when I open BBS a message comes out telling me:

"Detected problems with API compatibility

(visit g.co/dev/appcompat for more info)"

I have already given all the permissions. What should I do?
[BetterBatteryStats] pjadec:
Don't worry about that message. Try new dump to see if it works.
[BetterBatteryStats] MKchrias:
Had same message. Dump file shows

SELinux Policy:

BATTERY_STATS permission granted: true

BATTERY_STATS status: Failed: Transaction failed on small parcel; remote process probably died.

Will this be a problem?
[BetterBatteryStats] pjadec:
Which version BBS was used?

Have you taken battery savers off from BBS app?
[BetterBatteryStats] MKchrias:
BetterBatteryStats version: 2.5-337

Yes just done it.

Dump still shows same message.

Dropdown on main screen now gives Alarm & CPU States.

Raw stats says BatteryInfo service could not be contacted. All other options blank.
[BetterBatteryStats] MKchrias:
Could this be relevant?
[BetterBatteryStats] pjadec:
Yes, probably
[BetterBatteryStats] MKchrias:
I have tried everything I can think of on this and gsam. Looks like nothing work on note 10+.
[BetterBatteryStats] GeNiO790:
Battery problem

Hello, I am attaching my dump file. I ask someone if they can find out what my battery problem is.

Thank you.
[BetterBatteryStats] DB126:
Ditch (or quarantine) the Eurosport app. Fitness app/service (eg: smartwatch) also contributing to idle drain...albeit to a much smaller degree.
[BetterBatteryStats] MKchrias:
Galaxy Note 10+ 5G 512 exynos

Problem with BatteryStats service

Logcat with crash attached if someone could have a look.
[BetterBatteryStats] MKchrias:
Logcat from boot in case it helps
[BetterBatteryStats] kash296:
Hello,

I have been having problems with my phone draining a lot overnight. Here's a dump, hopefully it's been taken correctly and has some useful information to help me find out what's the problem with my phone. I'm on OnePlus 5. Thanks in advance!
[BetterBatteryStats] DB126:
Good dump; thanks for doing it right. :)

Nothing amiss w/Android leaving an incompatible kernel, aging battery and/or misbehaving or dirty hardware sensor as the most likely culprits.

That said, intuition suggests taking a deeper look at the Fitbit app and related wearable services despite no indications of misbehavior in the BBS dump. Disable or uninstall Fitbit app for 24 hours and see what happens. Good luck.
[BetterBatteryStats] kash296:
What do you mean by incompatible kernel? I shall try uninstalling the fitbit app and seeing how that works. Thank you!
[BetterBatteryStats] DB126:
BBS reports your device is running FrancoKernel which likely isn't stock. If the ROM or (more likely) kernel isn't communicating with hardware properly excess drain is one of the telltale symptoms.
[BetterBatteryStats] kash296:
Well probably there is something wrong on that end. Went full stock with root, no issues. Probably because of One Plus's firmware update. Sensors are still quite active, but drains are looking good both active and standby
[BetterBatteryStats] DB126:
For the benefit of future viewers was it the rollback or disabling/uninstalling Fitbit that fixed the issue?
[BetterBatteryStats] kash296:
For now I'd say it's reverting to my phone's stock ROM and kernel. I shall reinstall the fitbit app and test for a day or two. I'm sure fitbit is not the problem, as I've had the watch for a year and this phone for 2 years. Never had a trouble until recently
[BetterBatteryStats] Watanabe_You:
Can anyone spot what made me lose 10% overnight?
[BetterBatteryStats] DB126:
Nothing from Android as device was only awake for ~20 min (screen off) with no unusual activity and decent connectivity. Leaves aging battery, dirty sensor or unstable pie update. Of those my money is on the latter given Marshmallow era device. Rollback (if you can) and reassess.
[BetterBatteryStats] pjadec:
Probably fysical battery failure?

I don't find anything else what or was cause battery dtrain
[BetterBatteryStats] Watanabe_You:
Thanks, I'll replace the battery first. Don't wanna change roms right now.
[BetterBatteryStats] styla12:
Hi guys,

I appear to have a crazy amount of battery drain, and can't figure out what the issue is, can anyone read these logs attached and help?

Hoping I've done this correctly.

Many Thanks
[BetterBatteryStats] pjadec:
No good, too much screen on time over hour

screen on time less than minute
[BetterBatteryStats] mrjuniork:
Hey there..

You have almost done it correctly. You gotta make sure, that you don't use your phone while trying to figure out what the culprits could be. So in order to do that, charge your phone, unplug it and let it overnight, without using it at all. Your dump has 1h46m of screen on time, so that's 1h45m too much (or 1h45m30s). Basically try to achieve almost zero screen on time and then in the morning take a dump right away and save it. Like this you have an ideal and uncompromised dump. Then many experienced folks here could help you right away ☺

Good luck ?
[BetterBatteryStats] styla12:
Fantastic noted, I will do so tonight. Thank you very much!
[BetterBatteryStats] styla12:
Right guys, please find attached my corrected version it would be great if anyone can help figure out what's draining the battery for me please...
[BetterBatteryStats] strongst:
Hello,

Snapchat and American Express is draining 30min of the whole awake time alone.

Furthermore the wifi connection isn't the most stable one.
[BetterBatteryStats] styla12:
Any solutions on how I can fix that? Re the WiFi a bit surprised as WiFi I seem to get full strength... But Snapchat and Amex not sure why they would drain battery heavily?
[BetterBatteryStats] strongst:
Delete the apps, clear the cache, reinstall and observe :)
[BetterBatteryStats] skivnit:
Nvm
[BetterBatteryStats] devil-kin:
Could someone take a peek at this? Ofcourse, last night I only got a 5% drain, but my battery has been draining a lot faster lately, having to plug it halfway though the day to make it.

OnePlus 6, stock. View attachment BetterBatteryStats-2019-09-28_090227657.txtView attachment dmesg-2019-09-28_090227883.txt
[BetterBatteryStats] strongst:
Hello, 0.6%/h is good!

You have most of the time a really bad mobile signal

Poor Signal (): 7 h 42 m 4 s 87.2%

Which, when fixed, may reduce the drain too. But as said before, it's good anyways!
[BetterBatteryStats] devil-kin:
Yeah, that's the annoying part... Since it's been draining through the day a lot faster. Guess some app, just have to figure out which.

This overnight usage was with WiFi disabled.

The signal isn't much I can do about, except switch providers.

Is a dump during the day with little screentime any useful?
[BetterBatteryStats] strongst:
No it's not useful cause of personal settings/ environmental factors bbs can not record. Thus makes it impossible to analyze.

For example: If you travel a lot and your phones signal is that bad in idle dump and also while traveling, roaming between cellphone towers drains a lot of battery to keep signal strength up a minimal level.

Location settings and location permissions on and used by apps drains too.

There's more than those 2, but just for example :)
[BetterBatteryStats] devil-kin:
Yeah. I know. One thing I had noticed that there were quite a few wakelocks by lastpass, and that the cpu is 15-20% of the time in 512mhz. That seems excessive.
[BetterBatteryStats] strongst:
If a password manager causes wakelocks while you do not used them - > kick it. There's no reason unless he wants to communicate to something. I use keepass2android.
[BetterBatteryStats] DB126:
I use LastPass on multiple devices as I need (prefer) to share credentials across numerous platforms. The Android app is normally well behaved. If you conclusively trace actual drain (wakelocks are irrelevant) to that app might want to uninstall/reinstall and verify you're on a recent build. Much older builds did have a drain issue but that was resolved years ago. Good luck.

Edit: as a deterrent to OT (other readers) please refrain from finger wagging (and generally ignorant) rebukes of cloud based credential storage. I'm well aware of how LP and similar tools work.
[BetterBatteryStats] devil-kin:
Same use case for LP. And yeah, I'm not entirely sure it's LP that is causing the cpu to get stuck at 512mhz. 1h33m screentime and battery is at 60%
[BetterBatteryStats] chantoine:
BitWarden is OK with the battery fyi.
[BetterBatteryStats] redhonker:
Hi,

I followed How to Stop Wakelocks from Any Android App Without Root.

cmd appops set com.android.application WAKE_LOCK ignore

However, after that, I can see the same app showing up in BBS partial wak lock page at the very top.

Does it mean the ignore is not working? Or does BBS shows ignored wake lock as well?

Thanks
[BetterBatteryStats] fossils-n-dents:
Did you swap 'com.android.application' with the name of your app?

Have you tried adjusting the apps settings/ disabling the offending app/ then running the device without that app for testing purposes?

Have you done a proper idle dump, and submitted it to this forum? Just to be sure.

Personally, I've gotten in the habit of disabling apps not in current use. Less active apps = less wakelocks/ data usage. When I put my device down, it goes to sleep with minimum interference from Google/ Installed Apps/ Android.
[BetterBatteryStats] redhonker:
Yes I put in the correct package name. Before I try the idle dump, may I understand if the app will continue to show up after set the permission to wake_lock to idle?

Thanks
[BetterBatteryStats] tramp20:
Hi,

I need help with a mysterious problem (for me):

Sony Z1c with custom ROM AICP Android Pie

38% deep sleep over ~12 hours and only 3% battery lost.

Thanks for all help.
[BetterBatteryStats] Oswald Boelcke:
@ all: Some OT, please allow...

[MENTION=4138220]fossils-n-dents[/MENTION] I haven't seen you quite a while but it's great to have you and your advices back! XDA members will benefit.

(and out-of-thanks currently...)
[BetterBatteryStats] TNSMANI:
Suspend_backoff wakelock kept your device awake for more than 2 hrs. See THIS

Widget updates was another reason.

Your wifi didn't seem to work alright. There was constant switching between wifi and mobile data. Check your router.

Most likely because of these, your device was at 300 MHZ for more than 6 hrs.

Hope this helps.
[BetterBatteryStats] tramp20:
Thank you for looking into my log.

Mobile data is always off 24/7, wifi is off (Macrodroid task) during night. Therefor I do not understand this behavior.

As this is only a test phone for new ROMs it is not really important, just curious :)

Would flight mode help to prevent this constant switching?
[BetterBatteryStats] Oswald Boelcke:
^^I'm convinced. Definitely! Just give it a try if you don't need to recieve calls or text messages with that device. Obviously, during night you don't depend on data transmissions.
[BetterBatteryStats] TNSMANI:
Wifi On (): 11 h 44 m 52 s 100.0%

Wifi Running (): 26 m 29 s 3.8%

No Data Connection (): 11 h 44 m 52 s 100.0%

There was no data connected as evidenced above, but the switching happened. And wifi also ran for some time. Obviously the Macrodroid task was not very successful.

As Oswald said, switching to airplane mode should solve this.
[BetterBatteryStats] xumixu:
did you fixed this? i have the same issue on a Mix 2S
[BetterBatteryStats] tramp20:
With airplane mode it was now very bad :(

I will try another ROM (Lineage 9.0) .
[BetterBatteryStats] beatschubser:
The standby drain on my Mi Mix 3 becomes more and more noticable, and I cannot seem to find the reason.

Did a test over night as described in the first post. I hope you see something in the attached dumpfile.
[BetterBatteryStats] strongst:
Hello,

Your Sonos app, YouTube vanced and mobile phone signal are the main drainers. Mobile phone signal is worst all the time.

Do you hear music while idling?
[BetterBatteryStats] beatschubser:
I used YouTube Vanced to drain the battery from 98% to 95% Apart from that I didn't use the phone at all. So all the wake ups are coming from Sonos? I'm not even using their widget. It can't be anything else? Because they seem to random.
[BetterBatteryStats] TNSMANI:
Even with wifi off and with no data connection, the device switched and tried to connect to wifi or mobile data multiple times. I also see a steep increase in the number of apps trying to connect to the internet. I have never seen this number of apps trying to connect in all my years of visiting this thread.

May be, before changing the ROM, allow wifi during sleep and check the drain. However, numberwise, you had the minimal drain in your first scenario (0.3% per hr).

EDIT: [MENTION=613506]strongst[/MENTION] and others are also welcome to analyse.
[BetterBatteryStats] skivnit:
Hey guys,I keep getting big drains overnight. I also wonder why the partial wakelocks are only showing few things compared to what's it's showing in the summary stats View attachment BetterBatteryStats-2019-10-04_064532134.txt
[BetterBatteryStats] DB126:
Yep, crappy kernel (from a HW compatibility/optimization perspective) almost always yields crappy drains. Doesn't matter how you toggle the settings. Akin to giving CPR to an object that has bled out.
[BetterBatteryStats] strongst:
That's what is visible in the dump. If you don't have the same usage behavior, it's clearly random :)

So you see those apps are still active for some time in the background.
[BetterBatteryStats] beatschubser:
That's really strange, because you can restrict background activities per app in MIUI, and I have set Sonos to the most restrictive option. Still it seems to keep the phone awake.

Will try uninstalling Sonos and run another test tonight.
[BetterBatteryStats] fossils-n-dents:
Mr. Boelcke, the honor is mine. As a proud follower of your security/ privacy forum, I must say you have opened my eyes to many privacy related issues. I Thank You for sharing your insightful views.

I will absolutely assist when possible, but all seems to be in very, very capable hands.
[BetterBatteryStats] beatschubser:
Test #2: It's a litte bit better without the Sonos app, but the device is still awake 7.4% of the time. Any clues in the attached dumpfile?
[BetterBatteryStats] strongst:
It's very good, just 0.5%/h (you can compare with others in this thread).

Some minor network location wakelocks(maybe you have Bluetooth/wifi location scanning or GPS running).

But I wouldn't investigate more if you won't change more or remove more apps.
[BetterBatteryStats] krzylew:
hey guys, any idea why I can't grant this permission? device is Xiaomi Pocophone F1

adb -d shell pm grant com.asksven.betterbatterystats_xdaedition android.permission.APPOPS_USAGE_STATS

Exception occurred while executing:
java.lang.IllegalArgumentException: Unknown permission: android.permission.APPOPS_USAGE_STATS
at com.android.server.pm.permission.PermissionManagerService.grantRuntimePermission(PermissionManagerService.java:1410)
at com.android.server.pm.permission.PermissionManagerService.access$900(PermissionManagerService.java:89)
at com.android.server.pm.permission.PermissionManagerService$PermissionManagerInternalImpl.grantRuntimePermission(PermissionManagerService.java:2118)
at com.android.server.pm.PackageManagerService.grantRuntimePermission(PackageManagerService.java:5608)
at com.android.server.pm.PackageManagerShellCommand.runGrantRevokePermission(PackageManagerShellCommand.java:1730)
at com.android.server.pm.PackageManagerShellCommand.onCommand(PackageManagerShellCommand.java:217)
at android.os.ShellCommand.exec(ShellCommand.java:103)
at com.android.server.pm.PackageManagerService.onShellCommand(PackageManagerService.java:21888)
at android.os.Binder.shellCommand(Binder.java:634)
at android.os.Binder.onTransact(Binder.java:532)
at android.content.pm.IPackageManager$Stub.onTransact(IPackageManager.java:2809)
at com.android.server.pm.PackageManagerService.onTransact(PackageManagerService.java:4018)
at android.os.Binder.execTransact(Binder.java:733)
[BetterBatteryStats] skivnit:
Re for visibility...need help
[BetterBatteryStats] DB126:
Pull SD card and retest; suspect that will tame idle drain.
[BetterBatteryStats] Altindass:
I've removed powergenie for background apps. How can i reduce the battery using. %8 is killing me.
[BetterBatteryStats] githyanki:
Please submit an idle dump for assistance.
[BetterBatteryStats] Altindass:
Thanks for helping..
[BetterBatteryStats] Oswald Boelcke:
Not an idle dump, which is supposed to be at least six hours with less than one minute screen-on time. Please refer to OP for details how to produce a usable idle dump.
[BetterBatteryStats] Altindass:
Oh okay thank you. I'll upload it tomorrow
[BetterBatteryStats] Altindass:
How can i stop the powermanagerservice.wakelock
[BetterBatteryStats] DB126:
You are misinterpreting raw data to infer wakelocks are 'bad'. In most cases that is not the case but merely a symptom of some other activity that may or may not lead to excess drain. Submit an idle dump as previously requested for a proper analysis.
[BetterBatteryStats] Fahrialubis:
Anyone know what sensor is this? I wanna disable this sensor by sensor disable edexposed, this sensor always running like **** make my battery drain so hard
[BetterBatteryStats] krzylew:
Guys, I really need your help and opinion. My sister is experiencing a HUUUUGE battery drain on her Galaxy Note 4. It started about month ago, she claims that it happened after one of the Google Play apps updates, she doesn't know which one exactly because there were few of them and she doesn't remember.

I upgraded the bootloader and modem, flashed custom recovery and rooted the phone, installed some optimized ROM but that didn't help at all. I personally suspect some hardware issue because the drain is crazy, please take a look at the dump. What's most peculiar ist that the drain happens also when the device is TURNED OFF, tonight it went down from 82% to 6% overnight!!

EDIT:

Forgot to mention that she replaced the battery for a new one so the battery age is not the reason.