yashsingh1/xdaforums huggingface dataset:
[Android General] DB126:
It is important to correlate observed events to actual battery drain. Many (arguably most) wakelocks are benign. They fire, sometimes frequently, but no action is needed or taken. When excess wake time and/or drain is observed it's often easier and safer to tweak app settings vs blocking alarms/services which can have unintended consequences. When this isn't possible switching apps or disabling receivers or services might prove a better answer. Some wakelocks are generated by 'system' processes (eg: Google Play Services) that are difficult/impossible to reconfigure. In those cases Amplify may provide a benefit. However, simple acts such as disabling Google's location services when not in use can save significant juice with minimal side effects. Finally, one needs to distinguish between normal and extreme. I accept a certain level of idle drain (typically 0.2-0.4% per hour on my varied devices but sometimes higher) because wrestling that number down any further provides minimal corresponding benefit.
[Android General] PamelaGirl:
Hello All,

Just wanted to post an update on my battery using the Sony Xperia Z Ultra.

Sunday:

Level lost [%]: Bat.: -9%(100% to 91%) [1.1%/h]

Voltage lost [mV]: (4273-3987) [35.5%/h]

Tuesday:

Level lost [%]: Bat.: -1%(100% to 99%) [0.2%/h]

Voltage lost [mV]: (4237-4151) [14.5%/h]

I am very happy with the results thanks to this forum with all its wonderful help and support! To wake up to a phone that had been sitting for over 8hrs and see it had a battery drain of 0.2%/h puts a smile on your face. I think I will continue looking under the hood...

Thank you All! :)
[Android General] DB126:
Glad it worked out! Word of advise/caution: 0.2%/hr idle drain is about as good as it gets on most devices. You'll likely see some daily variations that may seem dramatic due to the small numerator. Avoid the temptation to respond to every incident; trends are far more important. Extreme (title of this thread) typically carries compromises and side-effects. Best aim for 'Practical Battery Life'. You'll retain your hair and have more time to spend with the kids. :)
[Android General] PamelaGirl:
Very well said and much agreed!

Lifes lessons have taught me when to leave while enough alone. As with most things if its overworked it slowly moves from becoming desirable to something unrecognizable. This is plenty good for me and my usage of the device.

Thank you! :)
[Android General] ProudRed:
Is it safe to limit any of these alarms ? Too much drain in idle state
[Android General] DB126:
Summit an idle log for analysis. These few Alarms are likely not the cause of your idle drain.
[Android General] ProudRed:
But my battery drain that time and there was no major alarm. I will still submit a log.
[Android General] WuNgUn:
I have a situation...

Did a clean install on my device, S8 port, turfed many apps I wasn't using, applied all my usual tweaks and settings... But my idle drain was 1.6% per hour. Not extreme drain, but 15% overnight isn't acceptable to me...

Id expect better performance from a totally untweaked device!

Using Leandroid, Greenify, enable doze on GMS (Magisk modules), disabled unused services and content providers...

I know my battery condition isn't bad... The previous night using my old setup was 0.7%/hr

Can you please have a look at my log?

http://cloud.tapatalk.com/s/59465874218ca/BetterBatteryStats-2017-06-18_061338872.txt
[Android General] DB126:
Nothing in the log is alarming - no pun intended. Yes, device was awake for ~9 min over an 8½ hour run but CPU frequencies remained in check with no rogue processes. Typical for for most Nougat based ROMs. My guess (and it's only a guess) is a hardware component failed to fall into a low power state. Could be one of the radios or a sensor. Make sure the kernel has been optimized for Android 7.x in general and the ROM in particular. Suggest a full power off to reset the hardware followed by another BBS run.
[Android General] :
I would definitely not call a ported ROM a totally untweaked device though ;)

Have you measured your battery drain in a stock ROM? If it is the same then the battery may simply be weak. If not then it may also be a software (ROM) issue.
[Android General] v7:
Keep it turned off.Related to the Keep Awake Permission In AppOpsXposed.

Tapped from my furious dogo ;)
[Android General] sdube3:
I followed this guide completely and although it is definitely improving my battery, I am having an issue receiving notifications, specifically from Gmail. In my accounts settings, it shows the syncing symbol constantly next to the Gmail checkbox. If I uncheck it and then check it again, Gmail syncs and I receive emails at that moment. But shortly after, I start receiving very delayed emails. Any thoughts?
[Android General] :
Would you suggest me to whitelist my VPN app? My phone doesn't send data when idle as far as I'm aware, but I don't know about GApps.

This could cause issues as the VPN reconnects when the screen is turned back on.

-----------------------------------------------------

You could write about 'F-Droid' and 'Amazon Appstore' alarms and services, many people are using third-party appstores.

---------- Post added at 11:53 PM ---------- Previous post was at 11:18 PM ----------

Couldn't MAT be replaced entirely with XPrivacy?
[Android General] Lasantha:
Please have a look at my better battery log. Thanks https://www.dropbox.com/s/kk1h8viwo7b3zz9/BetterBatteryStats-2015-06-24_045159734.txt?dl=0
[Android General] v7:
[MENTION=4274091]sdube3[/MENTION] Whitelist GooglePlayServices and GoogleServicesFramework in Power Nap.
[Android General] v7:
[MENTION=6556241]Musicbee[/MENTION] If you use a third party app for VPN,whitelist it in Power Nap.

AFAIK XPrivacy is a more like a permission manager.MAT is entirely different.We're using it to disable services and block boot items.I don't find a point in replacing MAT with XPrivacy.
[Android General] v7:
[MENTION=4150165]Lasantha[/MENTION] Limit com.google.android.gms.gcm.ACTION_CHECK_QUEUE to 40000 seconds.

I see that you're using Stock SONY ROM.Can you use Sony Stamina mode instead of Power Nap ,and post me an idle dump?
[Android General] Lasantha:
Sadly if I enable stamina it drains more battery. I don't use power nap. Just amplify+ Greenify +mat. I use battery widget 3c and now it shows -3mA darin. But in stamina it goes -300mA or more drain. This has puzzled me a lot. Thanks for the advice. I'll try to do a stamina on tonight and see
[Android General] usvimal:
After upgrading to the latest COS 12, phone does not wake up even after whitelisting android system. Any help?
[Android General] v7:
It is a known bug of Power Nap.

Tapped from my furious dogo ;)
[Android General] m0han:
i'm on a rom which is a 'spin-off' of cm12.1.

should i uninstall power nap module? my issue:
[Android General] v7:
[MENTION=4620757]m0han[/MENTION] AndroidSystem whitelisted?

Tapped from my furious dogo ;)
[Android General] m0han:
yes. :(
[Android General] iall5tar:
Hiho!

May can someone tell if this is OK or not?

Here is a dumpfile from this night with wifi on...

https://www.dropbox.com/s/epf5qftv5zzd9zo/BetterBatteryStats-2015-06-24_085238113.txt?dl=0

Cheers!
[Android General] Portgas D. Ace:
Losing 0,1% per hour is excellent.
[Android General] iall5tar:
Yes I know but what about the alarms? When I saw my Alarms at first was 99% com.android.google.gms

Is this normal?
[Android General] Portgas D. Ace:
You encountered about 15 alarms per hour from Google Play Services, which is quite normal. It hasn't drained any battery, so I guess it is okay. You could try to reduce the amount of those wakeups, but for this we need a screenshot of the sub-category of alarms. You can access them if you open BBS again (after you have done another idle run over night) and click on the Google Play Service alarm tab. This will open another floating window showing all related alarms with their corresponding number. This way you can identify the culprits and - if you like - limit them with Amplify.
[Android General] usvimal:
I uninstalled power nap and reinstalled again. It works perfectly now
[Android General] v7:
[MENTION=4250471]RohinZaraki[/MENTION] I've seen the post before.For now added a few to the OP.Let's see how it goes.

Tapped from my furious dogo ;)
[Android General] v7:
[MENTION=5647774]usvimal[/MENTION] It may happen again but only once in a while.Will wait for a stable release from [MENTION=4504254]waylaidwanderer[/MENTION]

Tapped from my furious dogo ;)
[Android General] WuNgUn:
Battery drain as measured by SOT, was as expected....

Idle, a lot of wakeup...

Right now, I'd really like to know what Android GMS is trying to do...

38 wakeup an hour? More than every other minute!?

And I don't think Leandroid is effectively shutting down the radios...?

http://cloud.tapatalk.com/s/5947b57eae432/BetterBatteryStats-2017-06-19_064524923.txt
[Android General] DB126:
Wakelocks and wakeups (and/or extended wake time) are different things. The former is a request that may or may not not result in significant device activity depending how the receiver responds. Nougat can doze/sleep effectively (minimal power drain) with dozens of wakelocks firing hourly. See previous responses for likely culprits. ROM/kernel optimization is suspect.
[Android General] DallasBelt:
Hello everyone. I have a question regarding Doze GMS Magisk module, which a user mentioned here: is it ok to use along with the recommended apps and configuration given in this thread? I mean, do we need to Google Play Services be optimized by the system? Thanks :D
[Android General] DB126:
Magisk and associated modules are outside the scope if this thread IMHO although others may disagree. Same can be said about SuperSU, Xposed and other enabling tools. My generic guidance is to proceed with a gentle touch and only rein in alarms/process/wakelocks/etc when demonstrated (by hard evidence on

your

device/kernel/rom) to be significant drainers. If you subscribe to that line of thinking then a reasonable response to your last inquiry is 'no' unless proven otherwise.
[Android General] DallasBelt:
All right! Thank you for your answer, I really appreciate it. So I'd better share a BBS log. I hope you'll have the time to check it. I'd say my battery life is great, since I don't use any social networks. But I could be missing some drainer app/servive/wakelock ?
[Android General] peterlee928:
if anyone is gonna find something, its [MENTION=5488402]Davey126[/MENTION]. he can find a piece of ratsh*t in a sea of horsesh*t so long as the log is submitted correctly :)
[Android General] maybeme2:
What is the nest tool to stop apps from automatically starting at boot?

I have a number of installed apps that start at boot. I prefer to stop them from doing that and I will manually start them when needed.

I am rooted and use Greenify but don't think that stops apps at boot.
[Android General] pjohn23:
you can use an xposed module named BootManager if you're on MM below
[Android General] ProudRed:
http://cloud.tapatalk.com/s/5948707eb5a3a/BetterBatteryStats-2017-06-20_061411446.txthttp://cloud.tapatalk.com/s/594870d2c512e/logcat-2017-06-20_061411714.txt

Lost 4 percent over 6 hours. Too many alarms from Android os.
[Android General] DB126:
My preference is SD Maid Pro which does not have an Xposed dependency. Section you are looking for is under App Control. You should also look into settings to make sure System Apps are exposed. Be aware SD Maid is not the easiest tool to use but is one of the most comprehensive as you can also go after broadcast receivers which have the same effect is boot time startups. Also note it is easy to hammer your device with indiscriminate actions. With great power comes great responsibility. :)

---------- Post added at 09:33 PM ---------- Previous post was at 09:28 PM ----------

Humbled but undeserving. I simply apply the lessons learned from the many wise minds who have selflessly shared their time, expertise and experiences with the community. Let's start with the OP of this thread (@v7) who sadly is no longer a regular contributor. Far too many other names to mention but their thoughtful contributions live on through this thread and others.
[Android General] peterlee928:
try myandroidtools. you can shut down the boot manager for both third party and system apps.
[Android General] DB126:
Appears you have submitted a logcat which is not generally helpful for drain analysis. See post #6 for instructions on creating a proper BBS log. I also suggest you modify the instructions with those shown here which allows the log to be created at any point in the battery discharge cycle and is a bit more accurate as screen-on time is automatically excluded.

---------- Post added at 09:43 PM ---------- Previous post was at 09:40 PM ----------

Also a great tool but a bit more challenging to use and even easier to hose your device if not careful. Tool selection really depends on your level of expertise, risk tolerance and ability to recover your ROM should something go wrong.
[Android General] peterlee928:
great point. it is more convoluted than sd maid pro.
[Android General] ProudRed:
These are the only options I have on my bbs and this is the xda one.
[Android General] peterlee928:
that is the one :)
[Android General] ProudRed:
http://cloud.tapatalk.com/s/5948b85a5a101/BetterBatteryStats-2017-06-20_061411446.txt

This is the one. Please check if this is wnough, If not I will generate one tomorrow once again.
[Android General] Oswald Boelcke:
Affirmativ, this is a "dump" file; however not the required idle dump.

Please generate and post another one taken in accordance with the advice by @Davey126 posted here.
[Android General] viralhax:
Nice

Thanks
[Android General] DallasBelt:
All right. I followed the instructions and here's the file. Please Davey, you're the man! :cool:

By the way, I read in the log "XPosed BATTERY_STATS module enabled: false". Does this mean that we have to use some Xposed module for BBS for better results? Sorry if there's already an answer to this in the thread, but it caught my attention just now as I'm posting this. Also, why there's a graph fot the Bluetooth of I never turn it on? Anyway, I hope you can check the log. Thanks a lot!
[Android General] githyanki:
You had good battery drain with. 6%/hr

The only thing i would change is opt out of the stats collection from Lineage.

The next largest drain was WhatsApp backup, which you could set to run less frequently.

The exposed module is not necessary, I think it would help to diagnose some issues if you were having some system drain that gets clumped together if you don't have it.
[Android General] WuNgUn:
Did a clean install, did my usual tweaks and got 0.3%/hr idle drain... That was with wifi, BT and data off, but NFC still enabled. I'll swap wifi for NFC...

Happy!
[Android General] DB126:
Fairly normal looking log with 18 min wake time and 5% loss over 7½ hours (~0.6% per hour). CM 13.x isn't the most efficient ROM and likely has not been optimized for the Zenphone 2 kernel. That said, probably not worth the effort of hunting down/trying alternatives unless you are experiencing other issues. Although the thread is titled "extreme" I look for acceptable and call it a day. Other thoughts:

- disable stat collection and reporting in CM 13 as this triggered unnecessary wakeups and network traffic; same with update checks if enabled

- make sure Greenify option "Doze in the Go" is enabled; especially important on Android 6.x based ROMs

- verify WiFi is enabled during sleep; noted a fair bit of mobile radio traffic

- however, on some devices the WiFi radio is less efficient when idling; I own one such example; WiFi remains off except during heavy network traffic

- disregard XPosed battery_stats flag; all good as currently configured

Purists will note that further reductions are possible using Amplify, ForceDoze, PowerNap, broadcast receiver blocking, etc, etc. Likely true, but are the potential benefits worth the effort given the floor for your device (sans network isolation) is probably in the 0.3-0.4%/hr range.
[Android General] DallasBelt:
Thanks a lot for the feedback! About Whatsapp, idk why the log says that it's waking up the device since I only use manual backup :confused:

---------- Post added at 04:12 PM ---------- Previous post was at 04:02 PM ----------

Thanks a lot Davey! Also appreciate your feedback! I do have enabled Doze on the Go, but Greenify's latest update considers that some apps (WhatsApp, YouTube, GMail) don't need to hibernate :confused: so I moved them off the list. About WiFi during sleep, did you mean enabled or disabled? Does it mean that the device won't be able to connect while sleeping, hence will not receive notifications? Oh, and what about Bluetooth stats? I wrote that it's always off. Why does it wake up the device? Again, thanks a lot for taking the time to review the log and give great tips and advise!
[Android General] DB126:
Your device has several radios. Mobile is used for phone and SMS; WiFi is typically limited to data although some phone/messaging clients also support those functions over WiFi. You'll need to experiment. As for BT I didn't look into that as your device is performing normally otherwise. Nothing you can do anyhow (within reason) if BT is toggled off.

Enjoy your device as-is. Aside from toggling off CM/Lineage stat collection nothing more needs to be done.
[Android General] DallasBelt:
Yes, you're right! I have no Nokia 3310 so, the battery won't las 5 days! But it has definitely improved since following this precious guide and by your (and others) great help :good: Thanks again!
[Android General] :
This actually may not be enough. There is a bug in CM13 which causes wakelocks related to the stats collection service. I think that it is caused by the fact the old server where the data was originally sent is no longer online. In my case the wakelocks persisted even with the stats collection turned off. The only way to block them was to disable the whole stats collection service (with My Android Tools).
[Android General] DB126:
Whoa - that may explain some odd wakes I detected on a couple devices running CM 12.1. Had a mental bookmark to dig into it further. Thanks for the great tip; will share findings if relevant. :good:

Edit: turns out the devices referenced above running custom CM 12.1 builds did not have the update service baked in. That said, tip remains relevant for CM 13 and possibly earlier CM varients.
[Android General] DallasBelt:
Could you please give some guidance about doing this? I downloaded My Android Tools but I don't know how to disable stats collection.
[Android General] ProudRed:
http://cloud.tapatalk.com/s/594a081a4ea29/BetterBatteryStats-2017-06-21_111059719.txt

Device was in Airplane mode. Lost 6% over 6 hours.
[Android General] :
Look for StatsUploadJobService in Settings under system services. I think the same issue was is also discussed here: https://www.reddit.com/r/cyanogenmod/comments/5yjfn8/massive_battery_drain_from_cyanogenmod_system. Just block the service completely and you should be fine. That is what I had been doing until a stable release of LineageOS was available for my phone.
[Android General] DallasBelt:
Good information! By the way, I found the wakelock in Amplify. Should it be fine if I limit it? If so, what would be the interval? Or do we need to completely block it, as you said?
[Android General] DB126:
Device was awake for <3 min during 6¾ monitoring window which is fairly typical. The 0.7% per hour (average) fall off rate is at the higher end of normal, especially in Airplane mode. Unfortunately, CPU states were not captured (not sure why) so can't tell how busy the CPU was during that time. There were no obvious app drainers but a ton of momentary sensor wakelocks. Hard to tell if these occured while the device was sleeping or when awakened due to 75 seconds of screen-on time before the log was captured. Only way to know for sure is to enable BBS Watchdog processing as previously suggested. As Greenify and Xposed are installed I assume 'Doze on the Go' is enabled.

So what to make of all this. A few possibilities:

- Battery is defective an not holding a charge (seems unlikely given age of device)

- rapid fall off immediately after coming off charger; some battery packs exhibit this characteristic

- BBS log is incomplete so not identify a zombie process/service that is sapping your battery (unlikely IMHO)

- Kernel is not placing some radios/sensors in a low power state when the device is idle (where my money is)

Looking at a few reviews battery life does not appear to be a common complaint for this device. However, most analyze screen-on endurance versus idle efficiency. Is your SoT reasonable?

Sorry I could not be of more help. Perhaps someone else will have a different read.

---------- Post added at 10:13 AM ---------- Previous post was at 10:09 AM ----------

Blocking the wakelock is like placing a bandage on an internal bleed. You really want to go after the source; best block the service as it offers no possible benefit given the demise of CyanogenMod. MyAndroidTools handles this nicely.
[Android General] ProudRed:
My SOT is good when its being used. But the battery drains mostly while idle. If You insist I will provide you with another log in next 12 hours. But please suggest me the changes I need to make this time for a better reading.

I will provide you with a log without Airplane mode. This device is like little more than one and half month old.

My Motorola Moto E which is like a 3 year old device with 1 year old battery drains 1-2% overnight.

Could this be because I keep play ssrvices hibernated ? Or due to the fact I greenify system apps ?
[Android General] DB126:
- see here for information on using BBS Watchdog processing (link was previously provided)

- as previously noted there is no indication ROM or apps are the source of drain

- that said, Play Services should NOT be hibernated; same for many system services

- please remove Play Services and other system services from Greenify list prior to submitting another log (or simply try it and see what happens)

- comparing Moto E to OnePlus 3T is akin to apples and oranges; different hardware, sensors, kernels, ROMs, etc

"If You insist I will provide you with another log...."

I insist on nothing. You can stop submitting logs at anytime. I don't recall billing for services nor have any obligation to volunteer time and effort to analyzing your concern. Lots of other threads if you want another opinion.
[Android General] ProudRed:
Dont quite see the reason for taking offence to it. It was more of an urge from my end, if can help you with a different sort of analogy. Thats what my statement should comprehend. I will degreenify all the apps in orange tonight before submitting another log.

Just one thing, by greenifying system apps I do get a lot of battery while in use.
[Android General] ProudRed:
http://cloud.tapatalk.com/s/594b205d5b51c/BetterBatteryStats-2017-06-22_070616619.txt

6% lost over 6 hours. Wasn't in Airplane mode.

All system apps including play services were taken out of greenify.
[Android General] githyanki:
Statistic Type: Charged to Screen Off

Since 5 m 1 s

Change to screen off to screen on.

Just open the file with text editor to look at it. It is not difficult to read.
[Android General] ProudRed:
Its not available anymore to change it upto screen on.

Just checked it, I will provide another log tomorrow.
[Android General] DallasBelt:
Guys, I was thinking if it'd be a good idea to create another BBS log with CyanogenMod stats collection service blocked? And maybe with DozeGMS Magisk module on. Do you think it would make a difference? Or it's just pointless?
[Android General] DB126:
Not sure you need to submit another log as the culprits have been previously identified. You can monitor the benefits from interactive BBS.
[Android General] DallasBelt:
You're right. I'm just going to test it for the sake of my curiosity :D Thanks a lot!
[Android General] David42:
Is this guide still relevant? It seems a bit old (2016). I need better battery life so I don't have to lug around my external battery pack.

Any newer guides out there? :confused:
[Android General] Oswald Boelcke:
XDA contains a really fantastic search engine.