yashsingh1/xdaforums huggingface dataset:
[BetterBatteryStats] DB126:
You've already identified the most likely culprits. Ambient display interrupts sleep which provides a window for numerous apps on your device to interact with the outside world, further prolonging the wake period. If during that time another notification fires, the screen briefly illuminates and the cycle repeats.

Ambient display on Galaxy devices behaves much the same way imposing a significant endurance penality for the convenience. For whatever reason Moto devices can perform a similar trick with minimal impact on battery life. In the end you'll have to decide which is more important.

Try disabling ambient display for a day or two.
[BetterBatteryStats] ColdUser:
On all Pie ROMS BBS resets the battery stats after reboot. I can only then choose since reboot, i would like to see also since unplugged even if i reboot. I remember that this worked. I dont know anymore which rom, i think it was xiaomi.eu.
[BetterBatteryStats] strongst:
Never heard that it worked. That's a normal behavior on android and not related to bbs.
[BetterBatteryStats] ZeUbermensch:
Unfortunately it didn't seem to help much, idle drain is still pretty high even with ambient display off (and disabling wifi scanning and location, which I normally leave on). I still can't really seem to figure out what is even causing all these problems.

This is what my battery graph usually looks like after a day of usage, I don't really think so many wakeups are normal...
[BetterBatteryStats] DB126:
With ambient display apparently ruled out you are going to have to go after user apps starting with those that are social oriented (anything that generates regular notifications). Facebook and Telegram tend to be the biggest abusers. Disable each for a period of time until you find the culprit(s). Good luck.
[BetterBatteryStats] peterlee928:
howdy all. just dirty flashed the latest factory image and boy is my battery draining. please see attached for my idle log. anything here that might shed some light? much thanks and hope everyone is enjoying a safe holiday weekend (for those of us in the states)!

EDIT

i turned off the double tap screen gesture after taking a glance thru the log. battery still seems to drain.
[BetterBatteryStats] whoodzzz:
BBS n00b here. No matter what I try, I can't get rid of the fallback to "since boot". I've removed and reinstalled the app, used the adb commands (both as adb and using the shell) but no dice.

I've removed all other monitoring type apps, there are no restrictions on the application so I'm kinda at my wits end.

Can someone pls help? Non rooted S10+ here.
[BetterBatteryStats] DB126:
Almost certainly a kernel issue as there are no significant drainers at the rom level. Most likely a sensor or radio failing to disengage or enter a 'low power' state. Probably need to clean flash or at minimum wipe system partition and see what happens.
[BetterBatteryStats] peterlee928:
much thanks! so i wiped dalvik cache via twrp. also used sd maid to clean system. anything further to do wrt wiping system partition? i would like to try this before clean flash (pain)
[BetterBatteryStats] githyanki:
That is the correct behavior. All the information BBS uses is wiped during a reboot.
[BetterBatteryStats] whoodzzz:
Thanks for replying.

Reading through the thread, that's something i picked up so I'm cool with that. I'm getting no stats recorded after unplugging my device from charge (it's been off for 4 hours now) which is where I'm getting confused.

Should've been more clear. It's captured the battery reduction by hour but that's it. No wakelocks, apps or anything else.
[BetterBatteryStats] Kippy51:
Maybe check your permissions? This is from my S7
[BetterBatteryStats] DB126:
Not sure why wiping only the system (not data) partition prior to reflashing stock is so painful unless you made a lot of changes there. Of course, you could always fall back to the prior build using the backup you clearly made before the latest dirty flash attempt ...
[BetterBatteryStats] whoodzzz:
Permissions are all missing and greyed out in app permissions. Started in safe mode and couldn't make any adjustments to them there.

Pretty annoying tbh.
[BetterBatteryStats] DB126:
Huh? No sure why starting in 'safe mode' is relevant. See link for guidance on adding permissions.

https://xdaforums.com/showthread.php?t=1179809&p=67819528
[BetterBatteryStats] GQJ:
BBS and Tasker

Hello,

My Tasker app produces solely null values when I make a task to create a BBS dump. Anybody know how to remedy this?
[BetterBatteryStats] Limakos:
Why would you use Tasker to make a dump if you can do you yourself through BBS?
[BetterBatteryStats] m44x:
Does anybody know what is the purpose of com.samsung.android.systemui.ACTION_STATUS_LOGGING? It constantly gives a bunch of Alarms.

S10e exynos
[BetterBatteryStats] GQJ:
With Tasker I can automate it based on a variety of conditions.
[BetterBatteryStats] Limakos:
But valid BBS dump is from phone on idle. Unless you want to make dumps from other activities.
[BetterBatteryStats] GQJ:
I usually use if for battery level dumps.
[BetterBatteryStats] DB126:
BBS dumps can be taken at any time...active, idle, whatever. How you intend to use the dump determines its 'validity' for the designated purpose.
[BetterBatteryStats] jvw:
Hope someone can help me to figure out what's draining my battery. The battery dropped 26% overnight, but it's already in 95% deep sleep.

It's a LG H930DS in Oreo. The phone is not rooted.
[BetterBatteryStats] TNSMANI:
Alarms: too many widget updates. Minimise the number of widgets or duration of the updates.

Location or scanning (wifi/BT) seems to be on. Then the usual suspects, Facebook, Whatsapp, Signboard etc. Whatsapp was also keeping the Significant Motion sensor awake for more than 2 hrs. and Google Play Services and Android System were keeping it awake for more than 2 hrs. And lastly your alarm clock.

If you can control these, your drain will come down significantly.
[BetterBatteryStats] DB126:
24+ min screen on time invalidates the dump for idle analysis (see OP). That said, there's a lot going on. Tons of processes, alarms, network activity, etc. Far to much to sort through/interpret. Probably time to simplify your life or start from fresh with a factory reset. As for elevated drain rate, possible the battery is starting to fail; more likely radios and other hardware components never get and opportunity to fall into a low power state. Did I mention there's a lot going on ...
[BetterBatteryStats] wraithdu:
Try setting a static IP for your phone instead of DHCP. If that fixes the problem, then your phone doesn't like your router. If you own the router, check if you have a value set for the DHCP lease time. If there is no value or it is something like 0, try changing it to 1440 (minutes = 24 hours). Check the same thing if you're using a static DHCP lease, as these lease times (dynamic DHCP versus static DHCP) are usually set in different places in your router config.
[BetterBatteryStats] juliooooo:
Unfortunately, I'm not the owner of the router. Instead, it's the university router, which supplies me in my student apartment.

I do have an own WLAN-router for using VoIP (more is not permitted) and for my intra-network and only connected once just for testing. Do you think there's a chance that the battery runtime differs (improves significantly) when connecting to my router, even though the connected devices have no internet connection or is it important for the test that the device does get an internet connection?
[BetterBatteryStats] wraithdu:
As it specifically relates to the problem, internet connectivity doesn't matter. However if you have apps that are trying to sync, they will fail and likely throw off the results a bit. Do you see a lot of awake time? That's another clue this might be the problem.

Can you just set your phone to a static IP on your school network? Maybe connect via DHCP then copy that IP into the static settings?
[BetterBatteryStats] juliooooo:
For the worse right?

Ah forgot to mention, that during WLAN the diagnose app "CPU spy" reports an approximately 30-50% Deep Sleep time while the CPU most of the time (50-70%) runs with 384 MHz (lowest value above deep sleep) and a few times (under 5%) with 1,12 GHz.

When I use 3G I have an ordinary ~95% deep sleep time.

But this only tells me that something is wrong with WLAN, nothing specifically...

Good idea, check that later. Hope I don't get exmatriculated from the university because of rule violation :rolleyes:

Right now, I've connected to my router, fixing the IP to static and after about 45 min. I can say that it seems to behave normally: 90% deep sleep, 6% at 384 MHz, 1% at 1,12 GHz. (But why does the CPU never use those steps between 384 MHz and 1,12 GHz ? Is it normal that only min. and max. is used?)

Edit: Although this boosts my hopes big time, it's still very much possible that the good values are only due to the lack of internet connection, right? On the other hand, you stated and I also believe that all those apps trying and failing to sync might resync, which should actually lead to a higher drain. Well, I'm just guessing...

Btw: Thank you veryvery much for you help wraithdu! Really felt lost up to now...
[BetterBatteryStats] wraithdu:
No problem. I had this issue with my Thunderbolt on a CM7 beta last year. Drove me nuts till I figured it out. It just sucks that it's at your school and you can't really do anything about it.

I did find that it was related to the kernel at the time, and Slayher was able to make some adjustments to help with it. So you may try a different kernel and see if it makes any difference, which yep, means rooting.
[BetterBatteryStats] juliooooo:
yeah rooting topic is next on the list, but really not sure whether I'm willing to accept a bricked phone, since it's my 1st one...

Did you see my edit in the last post? marked it green...

There is a huge thread in another forum concerning the battery runtime and most people said they would have about 2 days until they have to recharge. If it would be a kernel problem - and I guess I have the "standard kernel" because I didn't change anything - there would have to be a lot more guys being tortured ;) like me precisely everybody who doesn't root or change anything. That's why I think that the reason might be more of a problem of an app or a combination of certain apps.

Hoped that somebody could interprete those stats from BetterBatteryStats (posted on last page)...
[BetterBatteryStats] jeremysherriff:
Try using the stock launcher for a few days, Go Launcher can have huge battery drain. It seems to only happen to about 50% people, but there are dozens of threads throughout XDA on how bad the battery drain of Go Launcher is.
[BetterBatteryStats] juliooooo:
Hi, it's getting amusing, since the main reason for installing was to avoid Sense which I experienced as an energy sink during the first few weeks. Used the diagnose app "Where's my droid power" where sense stood very high on the drainer list.

GoLauncher works pretty well according to that diagnose app, plus if GoLauncher would be the reason, I definitely would have the same behaviour when using 3G instead of WLAN. But as I mentioned before, 3G doesn't make any trouble.
[BetterBatteryStats] wraithdu:
1) Yes, the lack of connection might actually cause MORE drain as apps try to sync and resync.

2) This problem seems to be very router dependent. As such, you might have this problem at school and not at home, or not at Starbucks, or not <insert location here>. With my Thunderbolt, it was just fine at work, but bad at home (until I changed the lease times in my router settings). You can't compare phones so much as wireless access points. If you know someone else on campus with your phone, on stock software, check with them if they have a problem.
[BetterBatteryStats] juliooooo:
I guess the next best test environment is indeed Starbucks hehe...why do I feel like a nerd right now? :)

But one last attempt: What do you think of the idea to establish a Wifi-Hotspot on the Windows7 desktop PC by means of a simple WLAN-USB-Stick? Windows7 can share its Internet connection and so I would connect the Evo via WLAN to the desktop PC and use the shared internet connection.

Assuming the Evo would show normal battery drain, would this "test environment" suffice to make the conclusion that the university router was all the reason for the battery problem?
[BetterBatteryStats] cdmackay:
Yup, that sounds plausible. Give it a try...
[BetterBatteryStats] wraithdu:
I agree. One point though, it's not the router's fault really. I don't believe any router breaks wifi spec. I just think there's certain configurations that a poorly written kernel doesn't handle well. For example, the config my CM7 TBolt didn't like was having static DHCP with a blank lease time. After filling in that lease time in my setup, the problem went away.
[BetterBatteryStats] bergerc:
Well that doesn't seem to have changed anything. LocationManagerService is still keeping the phone awake 90+% of the time :-(
[BetterBatteryStats] juliooooo:
Wifi-hotspot set up. hope it works over night. not sure if it's normal, but the battery is recharging at the moment and during that time the CPU doesn't go to deep sleep. Will report tomorrow...
[BetterBatteryStats] jeremysherriff:
You don't have to go back to stock, no other launcher has a poor battery drain reputation. ADW (free) would be my suggestion, and if you like it, buy ADW Ex. It's just a test for a day or two, or even just overnight - has the potential to make a big difference to you. But if you don't want to try, that's up to you.
[BetterBatteryStats] bendirkss:
My android os takes up second most of my battery next to screen. it says keep awake time is 7h. Betterbatterystats shows my most partial wakelock is 20m. Does this add up?
[BetterBatteryStats] jeremysherriff:
What does your kernel wakelocks say? Can you post a dump file?
[BetterBatteryStats] bendirkss:
Not to sure how to post a dump file but here's a screenie with no action
[BetterBatteryStats] jeremysherriff:
OK BBS hasn't caught the stats. Reboot.

To get a dump file, go Menu>dump to file.
[BetterBatteryStats] kizsleg:
Perfect for detecting culprit apps. Will make look better if we can see a "Screen On - Awake" widget. So that we will be able to see immediately if an app is disturbing our device's sleep.
[BetterBatteryStats] whoodzzz:
Yeah I followed the link and the adb commands, all permissions are granted. No other monitoring type apps are installed. Fresh install (and permissions again) makes no difference.

Pretty much ready to give up tbh :(
[BetterBatteryStats] jvw:
Only one weather-related widget on home screen, not sure why there're so many alarms. There is also no alarm enabled.

The log was taken last night before sleep and captured when I woke up this morning, never touch it during the 7+ hrs. Let me try to disable location to see if it helps.

---------- Post added at 09:12 PM ---------- Previous post was at 09:01 PM ----------

Phone was never touched during watchdog session (7+ hrs) with logging of screen off to screen on. The 24m awake was a screen off, is there anything I need to do to make the log more accurate?

Actually that's my wife's phone and she's doing some business so notification of certain apps (whatsapp, messenger, ebay, Etsy, etc) is required. If an app offers quiet hours they're also enabled. I'll try to disable location to see if it helps. Factory reset the phone for her is challenging (to me) but nothing is improved then I'll try and may root the phone too. I have the same phone with her with lots more apps installed then her, but my phone battery usually drops 1-2% overnight only.
[BetterBatteryStats] DB126:
Sorry, muddled the stats. Clearly only 6s of screen on time so idle log is good. I apologize for the error.

Obviously the number of apps is irrelevant; how they are configured is the differentiator. That said, it's possible the drain you are observing is kernel related (given low Android wake time) which usually points to misbehaving sensor, dirty fingerprint reader or other hardware fault.
[BetterBatteryStats] SkubiDoo:
I have notification about app compatibiliy on my op6. Can I check what is wrong and why ?
[BetterBatteryStats] curiousrom:
Re: Detected problems with API compatibility...

When you get an error notification it's good practice to mention the exact text of the error message & your exact device model & setup description.

I presume you are running Android Pie 9.0 and the error is Detected problems with API compatibility (visit g.co/dev/appcompat for more info). Visit that post for a link to the explanation & workaround.

[MENTION=1330150]chamonix[/MENTION] could you please visit that post & add the solution to the FAQ & fix the broken links in How-to and FAQ please? :confused:

The "Detected problems with API compatibility..." question is recurrent in this thread & it would be so much easier to send the users to that How-to and FAQ post. :cool:

***
[BetterBatteryStats] sunfire1:
Hello,

I'm asking your expertise for analyzing my BBS dump file. I'm loosing more than 1%/hour in idle mode (and a new battery).

Here are some infos concerning this dump :

- No recent app nor usage during the test

- No wifi/data activated

- Performance profile : "Efficiency"

- Galaxy S5 G900F LineageOS 16.0 klte build 2019-06-26 + Open GApps Nano + LineageOS AddonSU

I've tried this test in airplane mode and also in battery saver, roughly the same results, loosing 1%/hour.

Thank you for your help
[BetterBatteryStats] TNSMANI:
Two things:

This is not an idle dump because the dump was saved about 5 minutes after the phone was unlocked. This has to be less than a minute. Read the OP.

Next, at best this type of dump (on airplane mode) can be used to compare the results of other dumps with wifi and data on. This will not help in diagnosing the drain.

So take a proper idle dump with wifi and data enabled.

EDIT: You seem to have an old version of BBS. Please update before taking the dump.
[BetterBatteryStats] DB126:
You are running Android 9.x on an older device. Highly unlikely the hardware in general and kernel in particular has been optimize for idle power efficiency. A 1% avg hourly idle drain trends toward the high side but still falls in the 'reasonable' band given the platform.

I see no harm is evaluating idle drain w/inactive radios. In fact, that is one of the first scenarios I evaluate when tracing down idle draw issues. Keep in mind deactivating radios (any component) via ROM toggle does not necessarily power down the hardware and may be actually counterproductive if the component not placed in a low power state (if that option exists) before being 'disconnected' from the ROM.

Note: technical purists may take exception to some liberties used in the prior laymen's explanation; advance apologies for any fragile egos that have been bruised. [MENTION=5656100]tnsmani[/MENTION] - not you. :)
[BetterBatteryStats] TNSMANI:
Thanks:angel:

I am neither dogmatic nor egotistic. I am open to learning and know that what I know is hardly worth mentioning.:D
[BetterBatteryStats] DB126:
You know a lot, my friend, and definitely do not exhibit either of the above characteristics. I read your posts with interest and add 'knowledge nuggets' from your pen to my own puny cache.
[BetterBatteryStats] waylo:
I'm still having issues with the boot reference time being reset seemingly at random after the initial boot.

I'm on a Samsung Galaxy S9, T-Mobile, stock, unrooted, Oreo Android v8.0. I've made sure bbs is not killed by the native power saver. I'm not sure what else would cause the boot reference time to be reset. Oddly, other references such as unplugged remain accurate and are longer than the boot time when it is reset.

Are there any logs that would be useful to troubleshoot this issue?
[BetterBatteryStats] curiousrom:
Galaxy S5 LineageOS 16.0 Battery Usage @ Idle

Err... Doze in LineageOS 16.0 on Galaxy S5 is incredibly efficient as you can see in my attachments.

BetterBatteryStats is showing 0% battery usage in 8h 53m & -0.0%/h battery usage.

Note the WhatsApp & Reddit notifications in the Status bar.

The second set is of GSam Battery Monitor > triangle (Delta) > Since screen off reference point for an other idle test session. It also says "Used 0%" but in 8h 25m & -0.0%/h battery usage.

I'm pretty sure is not really zero as there are no decimals except for the %/hour so maybe it's from 80.9 to 80.1% for example but still it's less than 1% of battery usage in 8 hours of idle time in both tests.

***

Installed LineageOS as described in S5 LineageOS super clean install.

Applied the optimization tips described here including using LineageOS's Privacy Guard Advanced: S5 Remove Animations UI Speedup Test - Taming Google & Apps.

Installed BBS as described in Most Recent BetterBatteryStats & Proper Dump Settings

That's with my old S5 OEM 2015 battery, sync & Data enabled, default Balanced power profile, Play Store auto-update disabled on a Galaxy S5 G900M LineageOS 16.0 klte + Open GApps Pico + LineageOS AddonSU, no custom kernel or system mods of any kind, 200+ third-party apps including 20 with root privileges.

Note: the battery gauge from 100% to 92% is not reliable on S5 LineageOS 16.0 because it limits the max battery voltage when charging. See S5 Battery Fake 100% for explanations so always discharge the battery to 91% or less before collecting battery stats to check the battery discharge rate @ idle.

And I cleared recent apps before turning off the screen.

***
[BetterBatteryStats] DB126:
Yep - near zero hourly drain is possible on almost any device if you can suppress all background activity and hardware (sensor) 'interrupts'. I have gone that path on a couple gizmos for fun and to demonstrate viability. More recent Android builds ease the effort as Doze becomes more capable. That said, it's a high initial work effort for most and a tricky balance to maintain given common work loads. I still have an old Amazon tablet that can retain 50% of it's charge for several months if left undisturbed. Wakes instantly. Kinda fun if you have the time. Personally, I find 0.2-0.4% the sweet spot for most devices. Thanks for sharing.
[BetterBatteryStats] curiousrom:
Re: Galaxy S5 LineageOS 16.0 Battery Usage @ Idle

But I did not "suppress all background activity" as you can see in the attachment > GSam > View CPU minutes in the post above: Google Play services, WhatsApp, Reddit & Gmail were running in the background at one point and the notifications in the status bar were received while the phone was idling.

Not really if one limits the data collection permissions in his Google account & uses LineageOS's Privacy Guard Advanced (screenshot of the Bootup panel) for apps that don't really need to start at boot as described in S5 Remove Animations UI Speedup Test - Taming Google & Apps.

On a Galaxy S3 running LineageOS 14.1 with similar settings & apps I could not get lower than -0.2%/h battery usage @ idle.

Point is Doze in LineageOS 16.0 is more efficient & see no need for apps like Greenify for example.

When I don't need BetterBatteryStats for troubleshooting after getting good results, I freeze it (disable) with a third-party app to save battery but it's always installed & ready to serve.

OTOH I have GSam starting at boot as it uses very little battery, I like the cumulative battery stats & it's quick & easy to check what happened during idle on the fly with the > triangle (Delta) > Since screen off reference point(screenshot).

That's how I spot rogue apps that I installed recently. Then they get either tamed with Privacy Guard, or frozen until the next time I need them or uninstalled.

Note that you can create a Since Now reference point so the stats will not be resetted by turning on the screen for a few seconds or if you want to check the battery usage of a given app for example.

***
[BetterBatteryStats] DB126:
It will be interesting to see if other S5 users can easily duplicate your findings. If so you have found a better elixir that may be leveragable to other devices. My experience suggests an outlier but I'd love to be found wrong. No need for a lengthy follow-up post. Others will chime in if they have similar successes.

Thanks for sharing!