hey everyone. I noticed recently that my battery life on my m7 was really poor. The battery was draining at 6-8% per hour idling in my pocket, so I decided to see what was up. I noticed my cpu usage never went below 80%. I checked my app usage, but nothing specific was showing under battery usage in settings, so I did some googling. I downloaded a bunch of apps including Gsam and better battery life and saw mediaserver was thrashing the cpu nonstop, as well as logcat, and google play services was constantly waking the device.
I tried all sorts of things from the common reboot to adb commands. Finally, I found something that at least partially worked.
I downloaded an app from the play store called system tuner, which let me kill mediaserver, and instantly my cpu usage went from 80% to 7%. logcat also stopped when I stopped mediaserver. I have noticed no side effects from doing this. I hope this can help someone out there.
Now I just need to figure out 2 things:
1) prevent play services from wakelocking (up to 46 times per hour, wow!)
2) automate killing mediaserver on startup, as I noticed the issue returns everytime I reboot the device.
If someone out there can help me, it would be appreciated, and if I find out on my own, I will share this info here for all the people with the same problem.
EDIT: I found an app called mediaserver killer, which didn't work at first, but after updating my play store opened just fine. I set it to kill mediaserver on screen on, and hid the toast and app icon, which is about as automated as its gonna get.
play services is still wakelocking the device a lot, but much less since the update. I'm just going to call it a day and move on.
I have 2 questions, but first some background.
I use Project Fi. I'm on the Pure Nexus Rom (8/28 Stable), I have installed Xposed and am using the following modules (Amplify, Greenify, Exchange Security Bypass, and Secure Settings).
1. I used Amplify to block some wakelocks, namely location based services, and anything relating to facebook. I've noticed that, while I'm blocking several wakelocks of the NlpWakeLock (600 seconds), I've started noticing that this wakelock has been held open for a couple minutes at a time. When I look at BBS I see NlpWakeLock (com.google.android.googlequickseachbox.Google App) 20m which is about a little over 1/3 of the time the phone has been unplugged. A reboot did not seem to fix this. My device is not always awake, but it seems when this wakelock gets activated, it's being held open longer than it should.
2. In BBS i'm seeing several different instances of DozeService.xxxxxx, all related to system UI. Not sure why this is, I did not tought this service at all.
Any help would be appreciated. Let me know what additional information may be of help.
Hi guys,
so i newly setup my phone recently with OOS 4.0.3 in order to have a clean phone for the most efficient use.
For my surprise, for the first time using the 3T my energy efficiency was very good, i managed to get 4,5h SOT with the first 50% because i had almost no drain when the screen was turned off.
I attached the screenshots.
Basically, i just flashed OOS 4.0.3 and the newest franco kernel and magisk for root. I didnt use greenify (which i usually do), just the strict standby option in the android settings.
So far so good, but now to the part i cant understand.
I installed gsam battery monitor and gave it root access, so i can have detailed battery information.
From that point, i experienced again the standby drain combined with wakelooks, as u can see in the screenshot starting around 60% of the battery.
So far i uninstalled the app, i used greenify, but i cant get back when i had no wakelocks.
Is it really because of Gsam Battery? How can get away the standby drain without setting up the phone completely new?
PS: I also deactivated some of the access rights of apps, especially for play services.
Is it possible that they regain the access by themselves or that google play services is draining the battery
LazerH said:
Hi guys,
so i newly setup my phone recently with OOS 4.0.3 in order to have a clean phone for the most efficient use.
For my surprise, for the first time using the 3T my energy efficiency was very good, i managed to get 4,5h SOT with the first 50% because i had almost no drain when the screen was turned off.
I attached the screenshots.
Basically, i just flashed OOS 4.0.3 and the newest franco kernel and magisk for root. I didnt use greenify (which i usually do), just the strict standby option in the android settings.
So far so good, but now to the part i cant understand.
I installed gsam battery monitor and gave it root access, so i can have detailed battery information.
From that point, i experienced again the standby drain combined with wakelooks, as u can see in the screenshot starting around 60% of the battery.
So far i uninstalled the app, i used greenify, but i cant get back when i had no wakelocks.
Is it really because of Gsam Battery? How can get away the standby drain without setting up the phone completely new?
PS: I also deactivated some of the access rights of apps, especially for play services.
Is it possible that they regain the access by themselves or that google play services is draining the battery
Click to expand...
Click to collapse
Don't deactivate app rights of play services. It would break the functionality randomly and u won't know what happened. Just enable and reboot. Next time something happens, check the stat in gsam battery monitor. It's a good app and I am using it from 3 years.
It's not gsam I've had it installed on every phone for years and I always get amazing battery life.
I dont use google apps at all besides gmail and maps sometimes. But ill try around if it makes a difference.
I also cant believe that GSAM really is the problem there, but i didnt change anything else, i was just surprised of the good battery life and wanted to see the characteristics of battery statistics when i have a normal standby drain.
And immediatelly from that point on, the standby drain changed as u can see on the screenshots, even after uninstalling GSAM.
I now get 2h SOT with 50%, not 4,5.
So, is it possible that anything influencing that is changing by itself?
I didnt install any app or changed any setting, all i use was setted up in the beginning (franco, magisk, viper, all apps)
Yes google play store and google play services if you downloaded it and installed it that way? Google ruins battery life very randomly. If you restored a titanium backup or sideloaded the app then I have no clue. Even if you didnt do anything different there are a ton of things that can go wrong with android in the background. Recharge and reboot and start over.
954wrecker said:
Yes google play store and google play services if you downloaded it and installed it that way? Google ruins battery life very randomly. If you restored a titanium backup or sideloaded the app then I have no clue. Even if you didnt do anything different there are a ton of things that can go wrong with android in the background. Recharge and reboot and start over.
Click to expand...
Click to collapse
tried everything already + wiping cache/dalvik
I just now wiped also system and dirty flashed the ROM + the stuff i need. Ill see it that solves the deal.
I just cant accept to not have the control over my phone as thats one of the advantages of rooting. I got the same battery life with same usage with my 2,5 year old OnePlus One.
I run the same apps on every phone and this phone has doubled the performance and battery compared to my nexus 6 note 5 and nexus 6p. First phone I've owned that actually sleeps when I turn off the screen.
954wrecker said:
I run the same apps on every phone and this phone has doubled the performance and battery compared to my nexus 6 note 5 and nexus 6p. First phone I've owned that actually sleeps when I turn off the screen.
Click to expand...
Click to collapse
The OPO with CM back then was a dream.
Are u using any apps or adjust settings in order to tweak that behavior?
LazerH said:
The OPO with CM back then was a dream.
Are u using any apps or adjust settings in order to tweak that behavior?
Click to expand...
Click to collapse
I've been on CM13 since the day it came out Dec 11th. I was getting amazing battery and standby on stock since I got the phone late November. I use xposed for tweaking everything but no modules or apps or settings for battery savings.
LazerH said:
Hi guys,
so i newly setup my phone recently with OOS 4.0.3 in order to have a clean phone for the most efficient use.
For my surprise, for the first time using the 3T my energy efficiency was very good, i managed to get 4,5h SOT with the first 50% because i had almost no drain when the screen was turned off.
I attached the screenshots.
Basically, i just flashed OOS 4.0.3 and the newest franco kernel and magisk for root. I didnt use greenify (which i usually do), just the strict standby option in the android settings.
So far so good, but now to the part i cant understand.
I installed gsam battery monitor and gave it root access, so i can have detailed battery information.
From that point, i experienced again the standby drain combined with wakelooks, as u can see in the screenshot starting around 60% of the battery.
So far i uninstalled the app, i used greenify, but i cant get back when i had no wakelocks.
Is it really because of Gsam Battery? How can get away the standby drain without setting up the phone completely new?
PS: I also deactivated some of the access rights of apps, especially for play services.
Is it possible that they regain the access by themselves or that google play services is draining the battery
Click to expand...
Click to collapse
I found 4.0.3 would get wakelocks from location service. I have installed firmware from OOS 3.5.4 and used Leandroid, since then I've had my old battery life back.
damiensturdy said:
I found 4.0.3 would get wakelocks from location service. I have installed firmware from OOS 3.5.4 and used Leandroid, since then I've had my old battery life back.
Click to expand...
Click to collapse
I like that app, but its only fully functional with SuperSU. Do u know if there is any similar app also working with Magisk?
LazerH said:
I like that app, but its only fully functional with SuperSU. Do u know if there is any similar app also working with Magisk?
Click to expand...
Click to collapse
Which app? Magisk?
Magisk has its own root now. Fyi
Navi44 said:
Which app? Magisk?
Magisk has its own root now. Fyi
Click to expand...
Click to collapse
I know, but the app still asks for root permission with SuperSU for all the foot options
LazerH said:
I like that app, but its only fully functional with SuperSU. Do u know if there is any similar app also working with Magisk?
Click to expand...
Click to collapse
Some parts of it only work with SuperSU, sure. The important bit that fixes the MRa big does unfortunately.
Not found a magisk equivalent, but I'm eager to find one!
I just recently got my 3T two weeks ago running OOS 4.0.3 and I also notice a lot of wakelocks, especially when on mobile data (3G/4G).
I am still tinkering to figure out what are the root causes for wakelocks in this case.
I suggest you install BetterBatteryStats from XDA, it does provide a lot of good info. GSAM is good too but I prefer BBS. You can grant it permissions to Battery_Stats if you are not rooted.
Here are my findings so far:
Google Services likes to access the GPS a lot, so I turned of Location History. This resulted in fewer wakelocks when the screen is off.
I have changed the GPS and set it to GPS Only so that it doesn't use the cell towers and WiFi to help determine a location. I am not sure if this makes a difference for wakelocks yet.
I know Nougat has doze, I am not sure how well it works...fortunately there is Aggressive Doze in the battery section of the settings. I have not tested this yet but this is something I will look into once I have determined all others aspects that may be causing wakelocks.
I do have the LED notification light enabled and I am using LightFlow to manage it. It works in conjunction with the built-in LED settings from OOS. This is fine, but I do believe this may cause wakelock issues.
Once again, in my experience, I get a lot of wakelocks when I am on mobile data compared to being on WiFi and I am not sure why there is a difference.
Let me keep this short and to the point. As numerous other users, I am also extremely bothered by the huge Android OS drain while on standby. On average, standby drain is 3% - 4% per hour,which is unacceptable. Let me describe my condition and my findings.
My setup
Stock OpenBeta 10 - 12, stock kernel, with Magisk and greenify. Dual sim (Airtel + Jio). 4G mobile data always active on Jio. Drain remains same if I disable both/ one of the sims, turn off data, or switch to flight mode.
What I tried
Used this command from a PC to check if any rogue app is using too much CPU. It once showed me Google drive was constantly using 6% CPU, but it was an one time bug, rebooting fixed it and never showed up again. Clearly, active usage was not problem, only the standby.
Code:
adb shell top -m 20 -s cpu
Then I checked BetterBatteryStats and I always see such alarming "Wake (Screen Off)" times. As you can see in screenshot in attachment. It is almost 50% of total standby. It might seem if the wakelocks are due to Google Play Services or GoogleQuickSearchBox, but no! Google's app take wakelock only if the phone is already awake, the primary reason of waking up has to be checked by this tool called Battery Historian by Google
To use it,
Download the repository as Zip file from https://github.com/google/battery-historian
Install python 2.7 and add python to your path.
Unzip Battery Historian after downloading as ZIP and go to scripts folder.
Run these two commands in cmd with phone connected in USB Debugging mode
Code:
adb shell dumpsys batterystats > batterystats.txt
python historian.py batterystats.txt > batterystats.html
If you cant get python running, skip the second command and upload the txt file here.
Now you will have a HTML file, possibly around 4-5MB. Opening it takes a bit of time to fully load in browser, like 1-2mins. Be patient.
In this graph, compare your screen, wake_lock* and wake_reason rows. In my case, the wake reason is almost always QCOM SMD-MODEM or QCOM SMD-MPM. And loads of wakelock from RILJ_ACK. Both of these point to possible screw ups from OnePlus at proper optimization of the radio interface.
I am not exactly sure what this means as I don't have much expertise on the kernel level, instead I am an app developer. I highly suspect it is a bug at the firmware/radio level.
I urge everyone to post their own findings and also help in fixing the problem with proper explanation if anyone possesses the kernel level expertise. I have also included my own battery stats in the attachments, if anyone is interested in further investigation
RESERVED
Recently I've been experiencing heavy background drain on oos unrooted 5.0. I'm only getting about 2-3 hours sot, and as a result I performed a factory reset yesterday. After the reset the battery life was pretty much the same. I used the adb command from this thread (https://forum.xda-developers.com/oneplus-3t/how-to/battery-life-heres-how-fixed-t3536456) to inspect the processes running in the background and using CPU. From the chart, I notice an entry labeled "logd" that is consistently running in the background and using anything from 1-5% of CPU. In my battery stats in settings, cell standby and Android system are both above screen battery usage. I think that cell standby is caused by the use of LTE, but I don't know that is causing the Android System drain. Android OS also shows up but it's farther down the list. Does anyone know a solution or a reason as to why or what "logd" is doing constantly running in the background? In addition to logd, there are also several other processes running while the screen is off/on, but I'm not sure if they're significant as they never really stay on the page for long, while logd does.
ps. from time to time, I get a "bug report captured" notification even though I didn't intentionally take a bug report. After "bug report #1 captured" I get a "bug report #2 captured" a few minutes or hours later and then a "bug report #3 captured" ...etc. This only happens sometimes, and at other times it doesn't occur at all.