yashsingh1/xdaforums huggingface dataset:
[BetterBatteryStats] bertl_85:
I have a high battery drain on my OnePlus 5 during night, when the phone is idle.

I'm losing 15% - 25% every 8-10h.

I have already deleted almost every app, but the problem still exists.

After wiping the cache and rebooting the phone the problem sometimes disappear for 1-2 days and then comes back again.

I cannot post external links, so please copy&paste the below pastebin URLs manually. Sorry for the inconvenience.

BetterBatteryStats-2017-09-09_071459594.txt:

pastebin.com/CJ3FVaQH

logcat-2017-09-09_071459646.txt:

pastebin.com/479ff0PD

any help would be greatly appreciated
[BetterBatteryStats] fossils-n-dents:
Google Play Services (As usual) may be your culprit due to high PackageMeasurementService, NlpCollectorWakeLock, NlpWakeLock, *net_scheduler* usage located in the 'Wakelocks' section of your log. For a non-rooted device, I would recommend Package Disabler available from Play Store. PD is a paid app. Or use ADB/ Termnal Emulator commands. Without root, those are your options. (I could be mistaken)

*Make a backup of your system before making changes, or you may fail to recieve OTAs. Just reapply after OTA.

If PD acquired, Go to the entry for Google Play Services. Look for> "AnalyticsReceiver" and "AnalyticsSamplerReceiver", "AppMeasurementInstallReferrerReceiver", "AppMeasurementReceiver" and "PackageMeasurementReceiver" from within Google Play Services, and disable the aforementioned processes. Or use the search function within the entry.

While still in Google Play Services, look for> "AppMeasurementService", "MeasurementBrokerService", and "PackageMeasurementService" Or use the search function, and disable them.

Now, head to Google Play Store entry, locate "AppMeasurementReceiver", "FirebaseInstanceIdInternalReceiver" and "FirebaseInstanceIdReceiver". Or use the search function within the entry, and disable them.

*'PackageMeasurementReceiver' and 'PackageMeasurementService' will reset on any reboot. Reapply them after every reboot.

This procedure will drastically cut down on "com.google.android.gms/.measurement.PackageMeasurementService" and "net_scheduler" wakelocks.

Your device will retain full functionality.

Once applied, reboot to recovery, clear system cache (5-6 times in a row). Reboot, try another idle run. Post your findings.

Also, 'BleScanner_WakeLock' in the 'Wakelocks' section of your log. I would check to see which apps are using bluetooth, and are running in the background. Doze will not stop this. Disable Bluetooth when not in use (Optional).
[BetterBatteryStats] bertl_85:
Thanks for your quick reply. Can you explain what PackageMeasurementService, NlpCollectorWakeLock and NlpWakeLock is used for?

I'm also irritated by those sensors lines:

Do you know why WhatsApp and Google-Play-Services have such a high time there?

What does that mean?

==========

Sensors

==========

(com.whatsapp.WhatsApp): Sensor: BMI160 Accelerometer(1), wakeup=false, Time: 9 h 37 m 25 s

(Google Play-Dienste): Sensor: Unknown, Time: 40 s

Sensor: BMI160 Accelerometer(1), wakeup=false, Time: 10 s

Sensor: Significant Motion Detector(20), wakeup=true, Time: 9 h 2 m 46 s
[BetterBatteryStats] fossils-n-dents:
"NLPWakelock" is requested by Google Play Services, a core element of Android, and is tied directly to your phone's location reporting. So, approximately every 60 seconds, a CPU wake-up alarm is set off in order to place this wakelock into effect while your device updates its location data.

"PackageMeasurementService" is part of what I like to call 'Snooping' through Firebase Analytics. Firebase is a Google service that developers can incorporate into their apps to help them understand how users interact with their applications. It's sending feedback to the developer on how the app is used, what features you use most or never use at all, and things of the sort.

High times are present because Google and some app devs are extracting data from your phone multiple times a day. While small in each instance, they add up in say, 6-8 hours. Your battery pays for the transacion.

Sensor usage: Location is “ON”. There’s a reason the Google Services screen contains just one button to help you fix battery usage — a “Location” button. When apps want your location, they ask Google Play Services and it wakes up your GPS hardware, calculating your precise location. The GPS radio uses quite a bit of battery power, and all that GPS usage will be pinned on Google Play Services — not the app that requested your GPS location. Turn off location when not in use, or check individual apps location service(s).

To reduce battery usage associated with location services, navigate to Settings > Location and changing the Mode to “Battery Saving.” This will prevent Google Play Services from turning on your device’s GPS hardware when apps request your location. You can also entirely disable location tracking features from here if you’re desperate to save battery power. If you need precise location tracking in the future, go back and enable high-accuracy mode.
[BetterBatteryStats] bertl_85:
Ok, I got it. But still wondering why some location requests will make my phone staying awake for more than 3 hours in one night. This seems to be very high, as I removed almost every app on the phone. So there shouldn't be any app that asks for location.

If I look at the percentage of the wakelocks you mentioned, then they only have 0.1 % each.

But my phone was awake for 32,4%. Don't understand how those figures come together.

And as I wrote earlier, after cleaning the cache, the problem is gone for a while and I'm just loosing 4-5% battery a night, which is still a bit, but much less as in the posted example.

So if apps regularly are asking for location the behavior should be similar every night.

I still think that there is something weird going on on my phone.
[BetterBatteryStats] fossils-n-dents:
Okay, I TOTALLY overlooked your NETLINK/ wcnss_filter_lock/ [timerfd] high counts in 'Kernel Wakelocks' section of your log. My apologies.

You should try resetting the network settings of the device. This can be done by going into Settings -> Backup & Reset> Network Settings reset option. This will lead to your OnePlus 5 forgetting all known Wi-Fi and paired Bluetooth devices. After resetting the network settings, reboot your 5 and then try connecting it to a Wi-Fi network to see if that solves the problem or not. Preferably 2.4GHz network. Some users report problems using 5GHz.

After resetting the network settings, reboot your 5 and then try connecting it to a Wi-Fi network to see if that solves the problem or not.

If you still get that high NETLINK count on your 5 even after trying the steps mentioned above, I’d recommend you to do a factory reset. While this will lead to all data from the phone being erased, it will also help clear any doubts regarding a faulty Wi-Fi chip in the phone. If this fails, seek repair.

I still recommend you eliminate Google's data collection services on any device you acquire. Also, check yourWhatsApp settings for location tracking through GPS.
[BetterBatteryStats] Lughnasadh:
Just a thought about Netlink wakelock. I've had to deal with that on my Bullhead. I've tried all the above, including setting IP to static, setting printers on a different addresss, etc.... Pretty much tried everything with no success.

The only way I got rid of it was to change to a kernel that had an option to block NETLINK wakelock. For Bullhead, these include Franco, Jolla and Shadow kernels.

I"m all good now but thought I'd just pass along my experiences. :good:
[BetterBatteryStats] fossils-n-dents:
Static IP is a great idea also! Unfortunately, bertl_85 is not rooted for the kernel change.

Thank You for the assist Lughnasadh!
[BetterBatteryStats] azeem40:
Well, I did this idle test in airplane mode. Also, I have doze turned off in the developer options now. Would that have affected it?

Hmm, I didn't see any app in the statistics that was really out of whack. Dunno how I'd go about finding it.

I had airplane mode on. Without airplane mode, it drains a lot more. Should I try another run with airplane mode turned off?

I can do that. Thanks!

I already did that before, but thanks.
[BetterBatteryStats] fossils-n-dents:
Yes, submit a proper idle dump in accordance with how you would normally use your device. Wi-Fi (If available), and data turned on.
[BetterBatteryStats] XenomorphXx121:
Any help please?

Not sure what is draining the battery when idle
[BetterBatteryStats] XenomorphXx121:
Ugh don't know how I uploaded that picture too
[BetterBatteryStats] buffer overflow:
Maybe that girl is a case of battery drained...:laugh:
[BetterBatteryStats] Oswald Boelcke:
Screen on time must be less than one minute; your's more tha 24 minutes. Take a proper dump and post again (maybe without a picture).

Here's a very good procedure or check the respective battery saving threads.
[BetterBatteryStats] Rated R:
BBS 2.3 collects alarms stats only with Selinux in Permissive Mode. Is it normal?
[BetterBatteryStats] XenomorphXx121:
It was something I drew, attached the wrong thing and didn't know how to delete it
[BetterBatteryStats] Oswald Boelcke:
EDIT => "Go advanced", scroll down => "Manage attachments" and delete.
[BetterBatteryStats] bertl_85:
Many thanks for your further analysis.

Yesterday I just did another cache wipe and reboot of the phone, and did another log during night.

This time everything looks fine, as I normally would expect it from the phone.

Battery drain of 0,5%/h (previous: 1,7%/h)

Awake (Screen Off) (): 6 m 56 s 1,2% (previous: 3 h 7 m)

NETLINK wakelock is at 0,1% (previous: 7,6%)

CPU states show 98,8% Deep Sleep (previous: 67,6%)

But I did not change any settings at all on the phone.

So everything is perfect, but usually it will reappear in a few days.

BetterBatteryStats-2017-09-10_100502087.txt:

pastebin.com/PiRTv9Zr

I will now reset the network settings and reinstall WhatsApp. Hopefully this will do the trick. If not, I have to do a full reset of the phone.

Thanks a lot fur your help.
[BetterBatteryStats] kevindd992002:
[MENTION=1330150]chamonix[/MENTION]

Now that the BBS app has a built-in updater, is the HockeyApp still needed?
[BetterBatteryStats] abalam:
Guys a big problem here my idle is 1.68% but see nothing strange here:
[BetterBatteryStats] azeem40:
Here it is. Strange that all those android wakelocks have been significantly reduced. However, device was still awake for 53 mins.
[BetterBatteryStats] fossils-n-dents:
'qcom_rx_wakelock' in the 'Kernel Wakelocks' section of your log looks like a problem.

It's a wakelock that often happens when you are connected to a large secured network like a university or company. The network itself is waking your phone up and keeping it in an active state even when you are not using your phone.

Or, could be DHCP/IP issues from your device with specific routers. Have you tried using a separate Wi-Fi source to test?

Also, go to settings> apps> Google Play Services - delete data and cache then reboot your phone. See if this helps.

Lastly, try the ElementalX kernel (Or a different kernel) for OnePlus 5. I do believe this kernel is good for correcting qcom_rx_wakelocks. If you can swing it, get the EX Kernel Manager from the Playstore, it is specifically built for ElementalX kernels and offers extended flexibility. A paid app. But try the kernel alone first. **Always make a backup before changing kernels.

Seeing that you still have those high 'com.google.android.gms' alarms, you haven't tried my method to lessen thier effect. We'll talk later about that.

Get Facebook/ WhatsApp under control, check thier settings to lessen notification/ location issues. They are killing you. Facebook is throwing a wakeup party at your batterys' expense, and WhatsApp used 33 mb of data in 5 h 7 m. Is WhatsApp writing a book about you? Get a handle on that.

As usual, after any alteration to your system, reboot to recovery, wipe Davlik/ cache. Reboot.

Still, your log is in order with what you have going on. Getting below 1. 0% /h is within reach with proper discipline.
[BetterBatteryStats] githyanki:
I thought it was a good way to thank someone in advance
[BetterBatteryStats] chamonix:
Tbh I have never tested if the updater needs the companion app
[BetterBatteryStats] chamonix:
If you are rooted bbs relies on dumpsys so yes, selinux plays a role. You can change the behaviour by forcing api access to Alarms in the advances settings though.
[BetterBatteryStats] azeem40:
Thanks for your help. Once you help me answer the questions in bold, I will do another idle log.
[BetterBatteryStats] PeQuEsan:
Anyone else with Oreo and without root? I granted BBS battery stats permission and so using adb while in Nougat and it was working OK. Then I updated to Oreo and BBS is working intermittently... I've tried granting permissions again, and also listing them to be sure it has access to them (dumpsys package packagename if I recall well)... No joy.

Anyone in my situation? Is it working for you?

Desde el móvil...
[BetterBatteryStats] fossils-n-dents:
I was using the university/ business as an example. However, did you try to use a different Wi-Fi network (A friends or relative) to see if you get relief? You could also try and set up a Static IP address through your device also to see if that alleviates the qcom_rx_wakelock.

Try the kernel first without the EX Manager purchase.

My personal list of Google Play Services services that are safe for disabling is located here... I thought you would suffice with what I first provided.

https://xdaforums.com/showpost.php?p=73693320&postcount=32709

This closes up more of the background data leakage and processes that contribute to battery drain. Totally safe with no loss of device function. You can follow the conversations for my reasoning starting on page 3271.

In WhatsApp, using MyAndroidTools, go to the 'Service' tab> Third Party Apps> Whatsapp> disable 'Firebaseinstanceidservice' and 'Appmeasurementservice'

Then, go to 'Broadcast' tab, and disable 'Appmeasurementinstallreferrerreciever', Appmeasurementreciever', Firebaseinstanceidinternalreciever' and Firebaseinstanceidreciever'.

Look for the same services in Facebook. Actually, look for the same services in every app installed.

**Always create a backup before disabling services.
[BetterBatteryStats] azeem40:
I already disabled all of those in the list you provided. I'll do so for whatsapp. I could not find those services in Facebook.

Also, did not have any other wifi to test with.
[BetterBatteryStats] cpasoft:
There is a way to do this without root??
[BetterBatteryStats] TNSMANI:
A proper idle dump would be better for analysis. Charge your phone to 100%, leave it idle for 6+ hours with the same configuration you normally use (wifi, data, location etc). Unlock the screen, open BBS and save the dump for 'unplugged to current' and attach it here. The screen on time has to be less than a minute.

I noticed that your wifi is having issues. Better restart it before the test.
[BetterBatteryStats] Oswald Boelcke:
Not as far as I know.
[BetterBatteryStats] cpasoft:
I supposed it... :(

Thanks!
[BetterBatteryStats] fossils-n-dents:
Facebook is a known battery hog, I personally use my browser for FB. You could look into FB lite, or leave it be. Debloat and Greenify if you haven't. You could possibly look into an Xposed fork or Magisk/ Xposed module(s) solution to tame notification frequency.

Concerning connectivity issues, the last suggestion I can come up with is to reset your devices' wireless connections. I would suggest one more idle run afterwards, if no relief is found, a factory reset may be in order.
[BetterBatteryStats] chamonix:
My daily driver is an unrooted pixel XL and I have no issues whatsoever. Can you please tell me a little bit more about what you mean with "intermittently"? To make sure BBS has the right permssions go to settings - advanced - app permissions (in the app) and make sure BATTERY_STATS is reported as "granted".

You should be aware of the fact that BBS needs to be whitelisted (i.e. set to "not optimized") in (android) Settings - Battery - Battery optimization (this is not new to Oreo) to make sure that the apps is not prevented from receiving events like plugging/unplugging.
[BetterBatteryStats] NotATreoFan:
Anyone able to get BBS working on a Samsung 7.1.1 device, without root? I installed it on my T-Mobile Note8 this afternoon, and ran the ADB Shell command required to grant access to battery stats, but I still do not get any details.
[BetterBatteryStats] PeQuEsan:
What I mean is that sometimes I can see the stats (almost never), sometimes I enter the app and I get the message no stats collected.

Inside settings, advanced, I can't find any app permissions option... I'm using last play store version. But, I can see that battery stats permission is granted with "adb dumpsys" command. What I didn't know is that you must disable battery optimization. I never did it under Nougat, with no issue. I've done so now. We'll see!

Edit: still not working... Side note: GSAM Battery Monitor is having exactly the same problem... It is has needed permissions, but I can't see all stats.

Desde el móvil...
[BetterBatteryStats] kevindd992002:
How do you get the update the normal way anyway? Through the BBS app itself?
[BetterBatteryStats] dilruk:
Hey [MENTION=4138220]fossils-n-dents[/MENTION], appreciate if you could take a look at my logs. Love what you guys do here.
[BetterBatteryStats] fossils-n-dents:
You're looking good. Nothing really stands out as far as I can tell. The amount of apps you have running, and their interaction with Google Play Services and Android system is almost musical.

You could possibly see a slightly lower idle time by disabling Bluetooth, location, and auto sync (May delay some messaging/ emails) before putting the phone to rest. With Magisk, a Greenify/ Adblock module is available to you. Possibly going to the settings of your Play Store app, and disabling automatic updates (You can manually update). Also, rebooting to recovery, and clearing Davlik and cache may help also.

The most immediate impact that can be made is by deleting unused/ little used apps. Fewer apps equals less background operations.

Overall, I would suggest you simply enjoy your device.
[BetterBatteryStats] dilruk:
Thanks man! I already went through your services list and disabled all of them. Just wanted to check if there's anything else I can do. I will definitely go through my apps and clean up.

Thanks again for your effort :good:
[BetterBatteryStats] Bubba:
I have used BBS for quite some time over several devices and always been able to achieve pretty good battery using just the info in the app (never having to do a dump file) to calm down any battery issues. But in the past few months I am having problem succeeding. My Nexus 6P is about 14 months old and starting to have issues with the battery as is common for them. AccuBattery shows 85% health and I am going to replace it sometime soon. However I am also now having a pretty good drain where it use to sleep really well. I followed the posted procedure for the dump and to my untrained eye all I see is the weather app (which I only started using a week ago) that is awake quite a bit. The issue was present prior to changing weather apps and has been going on for a month or more (I really though it was the weakening battery). I have attached the dump and would be most grateful if a trained eye or two could give me some insight into what my issue could be and maybe point me in the direction I need to go.

Edit:

I will add that it seems to have gotten worse after I upgraded my home internet and modem/router but that may be a coincidence.
[BetterBatteryStats] fossils-n-dents:
'qpnp_fg_memaccess' in the 'Kernel Wakelocks' section of your log looks to be your issue. The wakelock is used when the phone receives any packet while sleeping. You will still get it while using device data (Cellular) getting notifications, alerts, emails, etc. On a Wi-Fi network many of the packets are just empty, the device won't sleep properly while waiting for the next move.

Some devices such as printer(s) on a network can broadcast packets that can wake your phone frequently. qpnp_fg_memaccess is part of that. With a business enterprise/ university network you have no real option except turning off Wi-Fi. On your home network, try a static IP and/ or switching to a secondary network not used by other devices (2.4GHz> 5GHz), maybe try a friend/ relative's network to double-check, reset the devices' stored network settings, or simply disable Wi-Fi when phone is put down to rest. (I'm just throwing ideas out there)

Facebook: A known battery hog. Try FB lite, adjust notification frequuency in settings, or use your browser instead. (Optional) Also, you could try disabling your weather app to check for a lessening in Wi-Fi/ data/ wakeup issues.

I also prescribe my list of services that lessen alarms/ wakeups from Android System/ Google Play Services. It can be found here...

https://xdaforums.com/showpost.php?p=73693320&postcount=32709 The short discussion on why I use this list begins on page 3271. (Optional but recommended)

All else seems fine minus the connectivity issue. Good Luck.
[BetterBatteryStats] Bubba:
Thanks for you taking the time to look at the dump and your input. If I might ask a few questions about your response I'd appreciate the info.

1. What you said about qpnp_fg_memacess I understand. Overnight (as in the dump) however there is nothing hooked to the network. All pc's and my printer are always off unless I am actively using them. But that wakelock is one that just recently showed up. Is it possible that it has something to do with the new modem/router? And if so will setting the static ip help in that issue? Or setting WiFi to be off during sleep?

2. You mentioned the connectivity issue. I saw those numbers but wondered if they were correct. At home I use a micro-cell (3G) due to where I live. It is only about 15 feet from where the phone stays at night. Even at work in a pretty good size city with 4GLTE I am showing No Data and Unknown Signal at 49%. right now. Do you have any idea why that would be?

I appreciate all the input. Facebook has never really given me a problem, but I guess there could have recently been changes in the app that would be now causing some. And I am currently working my way through your list that you provided.

Thanks again.

Edit:

Could the qpnp_fg_memacess have anything to do with battery temp and cpu monitoring done by EX Kernel manager?
[BetterBatteryStats] chamonix:
Knowing what causes this error that mean that your ROM's batteryinfo service is broken/borked. Can you please provide a logcat?
[BetterBatteryStats] stuart0001:
Here you go.
[BetterBatteryStats] chamonix:
02-11 22:51:17.958 I/BatteryStatsProxy(26046): invoking android.os.ServiceManager.getService("batteryinfo")
02-11 22:51:17.958 I/BatteryStatsProxy(26046): android.os.ServiceManager.getService("batteryinfo") returned a service binder
02-11 22:51:17.958 I/BatteryStatsProxy(26046): invoking com.android.internal.app.IBatteryStats$Stub.asInterface
02-11 22:51:17.958 I/BatteryStatsProxy(26046): invoking getStatistics
02-11 22:51:18.018 E/TAG (26046): An exception occured in BatteryStatsProxy(). Message: null

As I said, the implementation if the batteryinfo is borked. As you can see BBS gets a binder to the service but the call to getStatistics returns null.

There is nothing I can do about it except talk to the ROM dev if he's willing to take this up.

My questions:is batteryinfo running? has the source been changed/tweaked? what codebase was it compiled from?

BBS has been tested on all builds of batteryinfo at least on 2.1, 2,2, 2.3.5, 3, 4 (by me) ariants by users. The only ROM/build known to give the problems you report is MIUI (that's the reason of the toast message)
[BetterBatteryStats] Szczepanik:
Command Center

Command Center can be used to save logs;)

Cheers

Tom
[BetterBatteryStats] :
Touche!

Thanks for the heads up. Installed.
[BetterBatteryStats] aashgaur:
thnku so much ... i chnged the wifi policy and signed off from the latitude !!! i hope everything goes smooth now ... i ll give u another dump file tom. to see if theres anything wrong after that !! :)