yashsingh1/xdaforums huggingface dataset:
[BetterBatteryStats] smirciz22:
Hello. I am having a problem with the summary stats of this app. The stats are resetting in the middle of the day. For example, in this screenshot it says that my screen was on for 8 minutes, but in reality my screen was on for about 4 hours. I did not restart my phone or the app. This is happening on all the battery monitoring apps like accubattery or gsam.

I have a realme gt 2.

How can I stop this from happening?
[BetterBatteryStats] TNSMANI:
Which version of BBS are you using? Have you tried uninstalling, rebooting and re-installing BBS? And which version of Android?
[BetterBatteryStats] smirciz22:
BBS xda edition v3.4.0-525. I have tried uninstalling, rebooting and re-installing, it is still getting killed. Android 13.

Should I leave the event process notification on? I usually turn off the notifications from battery apps.
[BetterBatteryStats] TNSMANI:
You can try that though I don't think that it has any bearing with your issue. Apart from that, remove BBS from Battery Optimisation in Settings and if possible, lock BBS in Recents.

Also try a few earlier versions of BBS since some users have reported different behaviour with different versions.
[BetterBatteryStats] smirciz22:
I will try. The main problem is that some of the parameters reset - for example "Screen On". And I use the "charged" reference. I did remove it from battery optimisation and did lock it in recents and it is still happening.
[BetterBatteryStats] TNSMANI:
I am out of ideas since I think this is the first time anyone has reported this behaviour.
[BetterBatteryStats] Spaceoid:
Which version is advised to be installed on Android 13, latest LineageOS 20? I downloaded the latest one I could find, 3.4.0-525, but it does not even start on my device. Thanks in advance :)

Edit: I now had time to read a bit through the thread, and it seems a know issue that BBS is no longer working for certain devices. I am using a OnePlus 6, LineageOS 20 (Android 13, latest nightly).

Edit2: I am the most stupid horse. I disabled my root, thus BBS was not able to gather root access, thus it was crashing. Entirely my bad.
[BetterBatteryStats] smirciz22:
This is what I mean. Example of the data reported by the system battery analyzer vs BBS.
[BetterBatteryStats] mcichy10:
Hi. I have a battery draining problem in my POCO X5 Pro 5G. I can't find the cause of the problem. Everything points to a hardware problem and not a sofware problem. I have only been using the phone for a week.

The phone loses 10% of its battery in 8h of non-use, with wifi turned off and mobile data turned off and power saving enabled. A phone turned off completely overnight loses 2% battery. I don't know what to do anymore. The phone has the latest ROM from xiaomi.eu.

I'm uploading the logs from the BBS app below, but I don't know if they are collected correctly (I unplugged the phone when it charged over 90% and left it overnight).

Unfortunately, on the web I have not found people with this problem with this phone.

Please, help.

By the way, can BBS collect data for logs when I leave the phone off for a long time?
[BetterBatteryStats] TNSMANI:
@mcichy10

Your dump files (2) are not idle dump files. One is for a short period of ~8 minutes. Though the other one is for 9+ hours, you did not save the dump file immediately on unlocking the screen. You seem to have used it for nearly 8 minutes before saving the file.

Please read the first few posts of this thread and post a proper dump file for us to help you.

This is ok and is preferred.

BBS collects logs continuously whether using the phone or keeping it idle.
[BetterBatteryStats] mcichy10:
I did everything (I hope correctly) according to the instructions in the first post. I add the logs in the attachment. I hope you can deduce something from them. I locked the phone at 98% and left it. Immediately after unlocking I started BBS, set from/to references to 'screen off' and 'screen on'. Finally, I saved the logs.
[BetterBatteryStats] TNSMANI:
Logs are ok. But though your stats show

there are indications that the mobile signal was not that great. I don't know why. If the signal is patchy, that will hugely drain your battery.

The next biggest reason is

in Alarms. I am not familiar with this since I never owned a device with MIUI. If somehow you are able to control this, you can save some drain.

Location or Location scanning seems to be on. You can switch it off for the night. That will also save some drain.

Apart from these, nothing else jumps out. You can try a factory reset, if possible, or a clean flash of the ROM.

By the way, how old is your battery?
[BetterBatteryStats] mcichy10:
1. I removed sim card.

2. I will try to do something with this, but I don't know if i can help something for that.

3. Location scanning? Huh, what's that?

4. My phone is new, i bought it 3 weeks ago.

Btw. My phone loses about 2% battery when I leave the phone completely turned off overnight.
[BetterBatteryStats] TNSMANI:
Under Location in Settings, you will get Wifi and BT Scanning. Confirm that they are switched off. Even if your Location setting is off, wifi and BT will be used to scan and fix your location. It is supposed to improve the accuracy.

As per the dump file, your phone lost 1.2% per hour.

After attempting to control the Security center, save another idle dump file with the SIM card inserted, data on and wifi on but Location and Scanning off. Let us see.
[BetterBatteryStats] mcichy10:
Allright, I'll try it with wifi scanning and bluetooth scanning turned off, wifi on, data on, no battery saving mode.

Regarding com.miui.securitycenter - I found such information in BBS as in the screenshot (1) and I think it is related to the option in the second screenshot (2). I turned off battery optimization (on my previous phone with MIUI there was no such option at all). I can't do anything else with this system app. I will insert more logs tomorrow. Thanks for helping.
[BetterBatteryStats] mcichy10:
Sorry, but I will not not upload logs today. For some reason the BBS (with the screen off-screen on setting) only showed the last hour of measurements. The phone was untouched for the last 3/4 of the day, almost 18h.

Perhaps the screen was turning on when notifications appeared. I'll turn the phone with the screen down and try to collect data for another night.

By the way, it looks like the battery consumption was decreasing over time. You can see this in the screenshots.
[BetterBatteryStats] TNSMANI:
If you have difficulty with screen on-screen off, try to set a Custom setting by using the three dot menu at top right of BBS and save the file from Custom to Current.
[BetterBatteryStats] ppell:
Hi.

I recently changed my battery, since i had high drain and thought it was due to its age.

Unfortunately it didn´t (completely) solve the issue.

I sometimes have idle drain around 2%/hour overnight. On "better" days around 1% and slightly under.

But especially in short terms my drain is high. Like after 1 Hour idle it loses up to 3%.

Maybe it doesnt go into deep sleep well / fast.

Activ drain is a little better with around 15%/h with the new battery.

I hope you can help me figure this out.
[BetterBatteryStats] TNSMANI:
Yesterday's idle dump:

Your mobile signal is not ideal. It was only 'Good' for most of the time and for sometime it was 'Moderate', never 'Great'. That is one reason for the drain.

You seem to have BT on and your watch connected. That drains some more.

You were not on wifi so all background actions/uploads/downloads happened on mobile data. Coupled with a not 'Great' signal, that will drain a lot.

Today's idle dump:

Wifi was on but mobile signal was worse

Plus your wifi also seems to have issues. The background uploads/downloads happened on mobile as well as wifi indicating that wifi was not locked on continuously. Reset it by switching off the modem/router and switching back on after about 20 seconds and then check.

Otherwise, this too followed yesterday's.
[BetterBatteryStats] ppell:
Thanks for the reply

I feel its not consistent anyhow. The idle today was better, although the signal was worse (nearly 50% moderate). Is this just up to the background processes on mobile data?

Great signal is hard to get in my location.

can you point out a little more, what the problem with the wifi could be?

I´ll try this and get a new dump tonight.

Furthermore I have another idle dump from a few days ago. Signal was 99,7% good, wifi on, but idle drain 1,8%/h.
[BetterBatteryStats] TNSMANI:
A weak mobile signal will result in battery drain since the phone will be continuously searching for a better signal. When data is added into the mix, the drain increases. Generally battery drain on wifi will be less than that on mobile data.

I don't know what the exact problem is. But I see indications that the wifi connection is not constant (for instance the downloads/uploads happening on mobile data even though wifi was enabled). Unless you are using some settings/app for disabling wifi when the phone is in deep sleep and it doesn't behave properly, this should not happen.

In addition when you use BT and the watch even while sleeping, you can't expect lesser drain. Sometimes drain can be reduced if something is not behaving alright and we set it right. But at other times, unless you sacrifice something you can not gain.
[BetterBatteryStats] ppell:
Hi. Here's my dump file from last night. Reset all modem/router/wifi. Drain was 1,1 %/h.

I'm ok with a few % drain due to watch connected etc. But I think its still a little bit too high?!

There's another file where the phone lost 6% in 1,5 hour idle.

I assume, that it takes too long to go into deep sleep. In long term (over night) it's balanced out by time, but not in shorter periods. That's possible?
[BetterBatteryStats] TNSMANI:
Your wifi is still not alright. Also confirmed by uploads/downloads happening on data too despite wifi being on.

This coupled with your BT+watch and mobile signal issue is the reason for the drain. Eliminate them, you may have 0.5% or less drain. Otherwise you have to grin and bear with it.

Shorter duration dumps will have higher drain and over time they even out and settle. That is why the first post recommends atleast 6 hours of idle time for the dump file.
[BetterBatteryStats] ppell:
All right. Thanks for your help.

I'll see if I can solve my wifi problem. May another place for the router help or could this be a hardware issue?
[BetterBatteryStats] TNSMANI:
Sorry, no idea.
[BetterBatteryStats] mcichy10:
I did as you said. Here is log from last night. I don't know what happend, but battery usage was much smaller than before - 0,4%/h (now) vs about 1,2%/h (before). Only difference is that battery saving was turned off. I left phone faced down for whole night.

But unfortunately battery usage in normal using is still pretty high (in comparision with my old Radmi Note 7 with 4000mAh battery).

Maybe you will find something interesting in this log. Thank you in advance for helping.
[BetterBatteryStats] TNSMANI:
0.4% per hour is excellent. You should be content with that. There is nothing else to be done since BBS is used to measure idle drain and take any controlling actions needed. And there is nothing in the dump file that can further reduce your drain without affecting the way the phone functions.

Normal usage is different. For one thing, the mobile signal may not be as good as at your home. You may be travelling and that may affect the signal. You may be using various apps. You may be constantly unlocking the phone to check something resulting in the phone taking longer time to enter Doze and frequently disturbing its sleep. There are umpteen reasons that can cause higher drain during usage. The phone is not at fault. You may have to change the way you use your phone.
[BetterBatteryStats] mcichy10:
Thank you for your time. I think, maybe new battery and new phone require some time to learn how to cooperate? :D
[BetterBatteryStats] Newsplash:
Hello,

I've recently started to have issues with idle drain, going from around 1%/hr to 4-5% and I can't seem to figure out exactly what's going on from any stats or apps so I'm hoping my dump file will be able to get more insight.

From my testing, airplane mode will return my idle drain to normal levels. If there's anything else I can do to optimize drain to lower it even further, please let me know.

Thanks for any help!
[BetterBatteryStats] TNSMANI:
I don't see many issues though your drain rate is high. If you get drain of 1% per hour even on airplane mode, it might be a battery or hardware issue, How old is the battery?

Location seems to be on with BT also on and they drain. I don't see any reason for this kind of drain (4.8%).
[BetterBatteryStats] Newsplash:
Battery is exactly a year old as of today, although it is a replacement. It still has about 75% of the original capacity.

If my issue persists, I think I'll clean flash my rom and hope for the best.
[BetterBatteryStats] TNSMANI:
You can never rely on a replacement battery to behave like the original. I would not rely on the 75% capacity left.

You can try the clean flash.
[BetterBatteryStats] AndroidWars:
%100-%98 7 hour idle %2 drained. I think Its fine.
[BetterBatteryStats] TNSMANI:
Wifi and mobile data disabled. That is why the drain is so low.

If you want to check the real drain, enable both and then save an idle dump file.
[BetterBatteryStats] AndroidWars:
I will try with wifi idle. 👍
[BetterBatteryStats] AndroidWars:
Last night when battery filled at %100 I left the phone wifi on idle 3 hour 25 minute until the morning. (I woke up 3.00 am waited to fill full battery that because not higher than 6 hour. Sorry about that)

I thinks its fine any massive drain?

Thank u
[BetterBatteryStats] TNSMANI:
Drain of 0.6% per hour is good. If you had waited for the full 6+ hours it might have reduced.
[BetterBatteryStats] iChAbdulHaseeb:
For a few days, I noticed when I use my phone, it gives me screen time of at least 6 hours, but it drains a lot of power when the screen is off, sometimes up to 4%/hour. After installing some apps, I discovered that my phone's CPU never enters to deep sleep mode. One strange thing I have found is that the CPU uses a lot less power when charging than it does when using the battery. I am attaching my BBS log file. Can somebody help me what thing prevents my phone from deep sleep?

BBS log FIle
[BetterBatteryStats] TNSMANI:
This is not a proper idle dump file. You have used the phone for more than half an hour before saving the file. Please read the first few posts of this thread and post a proper idle dump file.
[BetterBatteryStats] iChAbdulHaseeb:
This is a fresh dump file, and despite my best efforts, I have only 5 hour window during which I cannot use my phone. The phone consumes 2.9%/h and never enters deep sleep mode. can you please analyze my log file?

BBS Log File
[BetterBatteryStats] TNSMANI:
Sorry for the late reply.

The drain rate was 2.9% per hour. The phone was awake the whole time and as you said, no deep sleep.

This process was running the whole time trying to get the apps to go to sleep, but without success. I am not able to find out which system processes or apps were refusing to go to sleep.

I found this under Kernel Wakelocks:

AFAIK, it represents the collective time the screen was on but in your case I don't know why it shows this number. The screen was on for seconds only.

Was Location or BT/wifi scanning on? If so switch them off while sleeping.

Likewise if BT was on switch it off.

Apart from these I don't find anything which can justify the drain. How old is the battery?

If the battery is fairly new, you can try either a clean flash of the current ROM or a factory reset.
[BetterBatteryStats] iChAbdulHaseeb:
Thank you for the analysis. Although the location and BT were off, the mobile data and wifi were always on.

The battery is roughly two years old, but it still provides about 7+ hours of continuous screen use, so I don't believe the battery is the issue.

The problem is the CPU usage. I have observed two strange things.

The CPU frequency is high (about 1.5 GHz) when the phone runs on battery and low (around 0.8 GHz) when plugged in, While I am using the same app in both situations.

And on battery, if I am not using the phone CPU frequency remains the same as when I am using.

Factory reset might be effective, but I cannot do it for now.

Is there a method for me to manually put my phone in deep sleep? Or, I could try deleting some apps. Based on my log, which ones do you recommend I remove?

Any other technique to discover a process that is continuously running in the background. Given that my phone is rooted, please recommend any suitable approaches.
[BetterBatteryStats] mazroui:
Here's your issue

Sensors

==========

(com.android.systemui.System UI): Sensor: TMD3702V Proximity Sensor (wake-up)(82), wakeup=true, Time: 4 h 45 m 57 s

Sensor: Binned Brightness(32768), wakeup=true, Time: 0 s

Sensor: Device Pickup Sensor(32769), wakeup=true, Time: 0 s

Sensor: Proximity Gated Single Tap Gesture(32770), wakeup=true, Time: 4 h 45 m 58 s

Switch off all options in your ROM that require proximity sensor and go from there, one by one you'll find the culprit.

Have a good one.
[BetterBatteryStats] TNSMANI:
You may not have many options. From your description of the CPU behaviour, I don't think that you have any major issue with the apps. It is the ROM/kernel, in my opinion. So uninstalling apps may not solve the drain. Only a clean flash or factory reset is likely to solve it.
[BetterBatteryStats] DiamondJohn:
have you checked for differences in what is actually consumi9ng the CPU & the difference in the two states? the top command is the first that comes to mind, but there are MANY more.
[BetterBatteryStats] ionut310:
Is bbs working for anybody on rooted A14?
[BetterBatteryStats] swaroopbhat:
I have a nothing phone 1 with custom ROM. My battery drains a lot sometimes(7x times the normal) when I'm using the phone normally or even when all apps are closed or when the phone is idle (with screen on). I noticed this via accubattery (app). This issue goes away on restarting but comes back a few hours later.

How do I use BBS to debug the root cause?
[BetterBatteryStats] TNSMANI:
BBS is used to find out causes for drain during sleep, not while using or when the screen is on. However, controlling drain during sleep may control drain during usage.

On how to produce an idle dump file, read the first few posts of this thread.
[BetterBatteryStats] swaroopbhat:
Is there any other way to monitor active processes' battery consumption while the screen is on? Because my battery doesn't drain a lot during sleep
[BetterBatteryStats] iChAbdulHaseeb:
This might not be the issue because the Proximity Gated Single Tap Gesture is used to check the phone by tapping on the screen and in addition to detecting false taps while in the pocket proximity Sensor is used.
[BetterBatteryStats] TNSMANI:
Sorry, I have never monitored my screen on use. I presume that maximum screen on drain will be caused by the screen. And the other drain will depend on your usage pattern. If your sleep drain is not much, then I would say it is your usage pattern that is causing the drain.
[BetterBatteryStats] tootsu:
Hello, yet another user with regular big battery drains overnight. Usually around 20%, sometimes higher than 30%. Here is a log from last weekend, I am surprised by the Awake (Screen Off) (): 2 h 40 m 1 s 30.0% line, but with my limited knowledge I cannot find anything that could explain this.

It would be great if someone could point me in the right direction. Thanks in advance!
[BetterBatteryStats] TNSMANI:
The mobile signal is not great all through:

The oscillation of the signal will result in the phone constantly searching for a better signal and that is a heavy drainer.

Whatsapp and Signal held wakelocks for long periods. Check the reason and also whether you can reduce them.

under Kernel Wakelocks. Google it to find out any way to control this. Otherwise a change of kernel/ROM is needed.

Background uploads/downloads happened on wifi as well as mobile data. When it happens on data, given the fluctuating signal, it will drain the battery. Usually, wifi is better than mobile data for downloads/uploads. I don't know why in your case the wifi is also not holding steady, resulting in usage of mobile data. Reset your wifi modem/router by switching it off for 20 seconds and then restarting it. It will reset the wifi and hopefully clear the issue.

This process was running for about two and a half hours. As per my understanding, the system was trying to shut down various processes of system and apps but not very successfully. This may be connected with the mobile signal issue.

So I would advice to check whether you have a better signal elsewhere in the house and place the phone there for another idle dump file. Before that reset the wifi as described above. Let us see the next dump file before proceeding further.
[BetterBatteryStats] tootsu:
Thank you very much for your detailed answer @TNSMANI

This is very good to know. I assumed that the signal was OK, given that it is Good or Great 99.5% of the time, but if this is a problem then I have a suspicion: my phone has 2 phone numbers (one on SIM, one on eSIM) and the eSIM is a foreign number on roaming which sometimes loses signal (I know because I get the SMS informing me that I'm abroad every now and then). I will deactivate this SIM card and reset the WiFi as you suggested, and hopefully this improves things. Thanks again!
[BetterBatteryStats] adr1st:
Which the latest version of bbs?
[BetterBatteryStats] TNSMANI:
ver.3.3-507 in Play Store or ver 3.4.0-525 linked in the second post of this thread for XDA members.
[BetterBatteryStats] Spaceoid:
What exactly does the No Data Connection stat in BBS mean?

For my phone, BBS states that I have no data connection for like 80% of the time, which in my opinion does not make sense since I rarely, if ever, have connection problems. It also seems not to be related to wifi usage, or if mobile network is used at all; like, right now, the timer of No Data Connection is incrementing continuously even though I have great connection, and even a YouTube video downloading in the background.

Sorry if this is a dumb question; I also tried Google and the search in this thread, but did not find a definite answer.
[BetterBatteryStats] TNSMANI:
From the 3rd post of this thread:
[BetterBatteryStats] Nekromantik:
anyone got latest xda version working with A14?

mine always shows no stats collected
[BetterBatteryStats] Spaceoid:
I have read that, too. But 'No Data Connection' is showing (and ticking up) even though I have wifi deactivated.

I thought it might have to do something with 4G, so I manually switched to 2G (wifi still off) - BBS is still thinking I have no data connection.
[BetterBatteryStats] TNSMANI:
Is that 'no data connection' or 'no or unknown data connection'?
[BetterBatteryStats] Spaceoid:
'No Data Connection'. :) I mean, it (supposedly) is no problem at all, my device works fine. I was just wondering.
[BetterBatteryStats] Zilla0617:
Its not compatible with A14 yet, I'm waiting for an update as well.
[BetterBatteryStats] mirfatif:
So what's the plan? They have removed getStatistics()/getStatisticsStream() in Android 14.
[BetterBatteryStats] AndroidWars:
Samsung s10+ Exynos sensors begins battery drains. What is causing of this? Anyone faced with this issue?

Before this issue sensors section was always empty.
[BetterBatteryStats] TNSMANI:
This is not a proper idle dump file. Please read the first few posts of this thread and save a proper file and attach it here.
[BetterBatteryStats] aaron89d:
Does someone maybe know what IWLAN_PROXY_WL UID means? It's giving me partial wakelocks for the duration of about half of the time my screen is off.