mediaserver, google play services and battery drain - One (M7) Q&A, Help & Troubleshooting

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.

Related

[Q] Google Play Services/Now Battery drain observations

So since the latest Google Play Services update, I have been suffering some serious battery drain issues. There are various mentions all around the internet and most point to the issue being 4.2.1, which, we aren't running.
I spent some time over the last few days trying to figure out what the issue is and have some observations. But, for some background, last few days I have been getting no more than 10 hours battery with no more than an hour or two screen time.
Google Play Services is listed as the biggest battery drainer with 49%, so I started looking into that.
First off, I noticed in battery stats that if Wifi is on, the device doesn't deep sleep, even though wifi is set to never on when sleeping, the wifi never turns off and the phone never deep sleeps.
First thing to try was turning off wifi, so, I turned off wifi, straight away, phone deep sleeps again.
Next I began messing with Google related things, first of all I "uninstall updates" on GPlayS, tested with Wifi on, great, no more battery drain, phone sleeps, BUT, phone keeps bugging me with notifications to update.
Next was to update, battery drain returns. So, disable Google Now in its own settings, battery drain remains when on Wifi, however, if I kill "Google Search" after disabling Google Now, the battery drain stops.
Various mention on the internet has attributed it to location history and location services in the "Google Settings" however I have had those disabled for a few days now and they seem not to be the issue in this case.
My conclusion so far is that the link between the latest GPlayS and Google Now is the real killer.
At present, I have Google Now disabled, and no battery drain, Wifi turns itself off as it should and the phone sleeps. This isn't a great solution since I use Google Now regularly.
I'm hoping that unless someone has come up with a realistic solution that doesn't involve disabling services, Google will release an update to fix the issue.
Currently without access to another device other than my N10, I'm unable to test whether this particular version of the issue is specific to the XZ or the GoogleNow/GPlayS versions.
My next test is to install Network Info from F-Droid and Better Battery stats, and see if I can attribute the thing preventing wifi from turning off during sleep, and hence the failure for the device to deep sleep, to a particular activity going on.
Further, I have already tested the GPlayS related services by disabling everything such as Calendar and Contact Sync, disabled all of books, movies, photo sync, disabled Google Plus, none of these had any effect on the issue, which all but rule them out of the equation.
Has anyone else got observations on this, is anyone else suffering the issue, or has anyone got a real solution?
I'm off on Holiday on Saturday and would really like to have access to Google Now back, but not have the battery drain that's going to kill my battery while roaming the streets of Rome without access to a charger.
alias_neo said:
So since the latest Google Play Services update, I have been suffering some serious battery drain issues. There are various mentions all around the internet and most point to the issue being 4.2.1, which, we aren't running.
I spent some time over the last few days trying to figure out what the issue is and have some observations. But, for some background, last few days I have been getting no more than 10 hours battery with no more than an hour or two screen time.
Google Play Services is listed as the biggest battery drainer with 49%, so I started looking into that.
First off, I noticed in battery stats that if Wifi is on, the device doesn't deep sleep, even though wifi is set to never on when sleeping, the wifi never turns off and the phone never deep sleeps.
First thing to try was turning off wifi, so, I turned off wifi, straight away, phone deep sleeps again.
Next I began messing with Google related things, first of all I "uninstall updates" on GPlayS, tested with Wifi on, great, no more battery drain, phone sleeps, BUT, phone keeps bugging me with notifications to update.
Next was to update, battery drain returns. So, disable Google Now in its own settings, battery drain remains when on Wifi, however, if I kill "Google Search" after disabling Google Now, the battery drain stops.
Various mention on the internet has attributed it to location history and location services in the "Google Settings" however I have had those disabled for a few days now and they seem not to be the issue in this case.
My conclusion so far is that the link between the latest GPlayS and Google Now is the real killer.
At present, I have Google Now disabled, and no battery drain, Wifi turns itself off as it should and the phone sleeps. This isn't a great solution since I use Google Now regularly.
I'm hoping that unless someone has come up with a realistic solution that doesn't involve disabling services, Google will release an update to fix the issue.
Currently without access to another device other than my N10, I'm unable to test whether this particular version of the issue is specific to the XZ or the GoogleNow/GPlayS versions.
My next test is to install Network Info from F-Droid and Better Battery stats, and see if I can attribute the thing preventing wifi from turning off during sleep, and hence the failure for the device to deep sleep, to a particular activity going on.
Further, I have already tested the GPlayS related services by disabling everything such as Calendar and Contact Sync, disabled all of books, movies, photo sync, disabled Google Plus, none of these had any effect on the issue, which all but rule them out of the equation.
Has anyone else got observations on this, is anyone else suffering the issue, or has anyone got a real solution?
I'm off on Holiday on Saturday and would really like to have access to Google Now back, but not have the battery drain that's going to kill my battery while roaming the streets of Rome without access to a charger.
Click to expand...
Click to collapse
I shut it off it was draining my battery!
I had the same problem.
And here's a solution for you: Factory data reset
After that there will be no problems with battery drain.
NXT3 said:
I had the same problem.
And here's a solution for you: Factory data reset
After that there will be no problems with battery drain.
Click to expand...
Click to collapse
I did a factory reset and have the problem.
So the amount of battery drain has lowered significantly, but it is still there. I attached a screenshot from before the change and a screenshot from after.
use link 2 sd ( root required ) search at playstore
open it and seacrh google play service
option and sleep it..and u done
echopark15 said:
use link 2 sd ( root required ) search at playstore
open it and seacrh google play service
option and sleep it..and u done
Click to expand...
Click to collapse
it must be a way without root
Update Google play Service to version 5.x

no root, what do these system apps do?

I dosabled google play services cause it eats up my ram and battery but im not sure what it does. My phone is still running fine.. Should i enable it back?
Also what is "devices"? What does it do and can i disable it as well?
Any other useless system running apps i can disable? Thanks.
I think Google play services is linked with Google Play Store, I'd be hesitant about to disable it.
Even if you disabled Google Play Service to get more free ram, Google Play will ask about it at the right time when you try to connect to it.
Ok so first day without the annoying google play service and i noticed a massive improvement in battery life. Before i was getting an hour of standby time per 1 percent battery. Now i got 7 hours from 100-99%. And then dont know why but the succeeding was about 3 hours per 1 percent after that. Still, massive improvement. I am currently on 2 hours screen on time. Surfing, youtube, gaming and texting. I still got 65% battery.
I can still use google playstore without problems. First time i clicked youtube it said i need to update and enable gp services for app to run but i ignored it and it is still perfectly fine. The notice doesnt come the 2nd time you clicked the app so all good. Same goes with maps. No prob at all.
So my conclusion is that google play services is nothing but bloat trying to steal your info every once in a while hence, the battery drain. Try it and you will see what i mean!

Battery preservation strategy

I've been thoroughly impressed with battery life on the Moto Z as a result of normal use. Less so with idle battery consumption. That is, after installing my full complement of apps (including facebook and twitter), I did a few tests by going too bed on a full charge, and found that 7 or so hours later, it had burned down 15-20% doing nothing overnight!
I installed gsam batter monitor since the stock one is kind of useless. This provided a lot of valuable info, which is basically that Twitter is a huge hog, Facebook surprisingly isn't, and google play services also seems to be spinning its wheels a lot when I'm doing nothing. But most of my juice was going to powering the wifi radio.
Android M has a setting to turn off wifi when the phone is sleeping. I was reluctant to do this at first because I figured my apps would just start wasting my data instead. However, you also have the ability to selectively limit apps' ability to use cellular data when running in the background. In an app's settings you can click "Data Usage", then "Restrict app background data."
I did this for all the apps that gsam identified as being the wifi/battery users. And frankly there are almost no apps that I actually want using data when I'm not using the app itself anyway, except SMS and gmail. (I wish there was a way to just say "actually shut this app down when I close it", so I could activate it for most apps!)
Anyway -after doing this, I activated the setting to turn off the wifi radio when the phone was sleeping.
Result? 2% battery drain overnight, and minimal cellular data use. Amazing.
(Btw - I also uninstalled the twitter app and just put a link from chrome on my desktop. The web mobile app is very good anyway and I'm not much a twitter addict so this is a fine alternative that is a lot less intrustive for me).
jamtre said:
I've been thoroughly impressed with battery life on the Moto Z as a result of normal use. Less so with idle battery consumption. That is, after installing my full complement of apps (including facebook and twitter), I did a few tests by going too bed on a full charge, and found that 7 or so hours later, it had burned down 15-20% doing nothing overnight!
I installed gsam batter monitor since the stock one is kind of useless. This provided a lot of valuable info, which is basically that Twitter is a huge hog, Facebook surprisingly isn't, and google play services also seems to be spinning its wheels a lot when I'm doing nothing. But most of my juice was going to powering the wifi radio.
Android M has a setting to turn off wifi when the phone is sleeping. I was reluctant to do this at first because I figured my apps would just start wasting my data instead. However, you also have the ability to selectively limit apps' ability to use cellular data when running in the background. In an app's settings you can click "Data Usage", then "Restrict app background data."
I did this for all the apps that gsam identified as being the wifi/battery users. And frankly there are almost no apps that I actually want using data when I'm not using the app itself anyway, except SMS and gmail. (I wish there was a way to just say "actually shut this app down when I close it", so I could activate it for most apps!)
Anyway -after doing this, I activated the setting to turn off the wifi radio when the phone was sleeping.
Result? 2% battery drain overnight, and minimal cellular data use. Amazing.
(Btw - I also uninstalled the twitter app and just put a link from chrome on my desktop. The web mobile app is very good anyway and I'm not much a twitter addict so this is a fine alternative that is a lot less intrustive for me).
Click to expand...
Click to collapse
I just got the phone a couple days ago. I appreciate the info here. I have also read that if you just turn wifi to 2.4 GHz only that it will keep the battery drain from happening. I don't use twitter or facebook so don't have to worry about those. Google play services has been a problem since marshmallow. If we could root we could use something like Amplify to stop all the wakelocks, but root is getting hard to come by on these new phones.
I noticed on Gsam that my phone will sleep well for a while, then the "held awake" category starts to take off. I have to reboot to get it to doze again. I have agressive doze and doze on the go activated in Greenify. Not sure what gets it started, but it would be nice to be able to kill it off without rebooting.
I bought a USB C to regular USB and have been charging without the Turbo Charger and the battery is doing so much better.
I was getting frustrated with the battery performance.
Sent from my XT1650 using XDA-Developers mobile app

Help with Google services/play services battery drain

Was hoping someone could help, or if anyone else has been having this problem.
Been having an intermittent problem with huge, fast battery drain from Google services and play services. Sometimes phone is on high accuracy in location settings and I don't get the problem. Then for no reason I can see, suddenly the battery is dropping by 20% per hour in standby with Google services or play services at the top of the list using way more than anything else. Tried using device only and battery saving setting in location, but get the problem with them as well. Toggling off location entirely seems to stop it. Tried uninstalling play services and reinstalling it, as well as other troubleshooting I've read.
Stock, 4.4.2 xt1058 on AT&T, rooted
Have been searching online for a fix, but nothing as to why it's happening.
Hoping to figure out what causes it to suddenly start, seems to be most of the time now.
Thanks in advance for any help.
Get amplify and put xposed on it. Then limit the wakelocks. That is the easiest and most brutal solution.
Orcam said:
Get amplify and put xposed on it. Then limit the wakelocks. That is the easiest and most brutal solution.
Click to expand...
Click to collapse
Thanks. I had it on my phone at one time, but never used it as I wasn't having this problem. Will download it and try it out -hopefully I can determine exactly which wakelocks I'm having. Hopefully with Gsam battery detector, or Amplify, or another wakelock detector I can identify the culprit.
Amplify should tally all wakelocks well for you. Wakelock detector or BBS would give you a bit of a clearer picture. Make sure you do some reading about what intervals to limit stuff on with Amplify.

Odd battery life

Hello,
Since the purchase of my phone XZ1 Compact (G8441), I've been experiencing barely acceptable battery life. This is especially frustrating since I bought this phone having heard that it can last easily 2-3 days, but this is not the case for me (discharging about 4%h on average or 2.5%h with screen off on either wifi or mobile data, with various configurations outside/home/office, i.e. in practice never usable more than a day).
According to *#*#SERVICE#*#*, the battery life is still good (2704 mAh). The issue I am experiencing is most likely due to an unknown software and/or hardware failure leading to lots of wakelocks that prevent the phone from "sleeping"/"dozing" correctly.
I know that MANY users worldwide are experiencing this and Sony never gave an answer to this, according to e.g. the following threads:
https://talk.sonymobile.com/t5/Xper...-drain-after-update-47-1-A-12-235/m-p/1337029
https://talk.sonymobile.com/t5/Xper...-drain-after-47-1-A-12-205-update/m-p/1328053
https://forum.xda-developers.com/xperia-xz1-compact/help/battery-life-bit-odd-t3688342/page8
https://talk.sonymobile.com/t5/Xperia-XZ1-Compact/High-battery-drain/m-p/1326474 https://talk.sonymobile.com/t5/Xper...-drain-after-update-47-1-A-12-270/m-p/1340671 https://talk.sonymobile.com/t5/Xper...pie-battery-drain-CPU-idling-high/m-p/1354891
and many others
In my case the items "NlpWakeLock" and "RILJ_ACK_WL" activate both up to thousands of times every hour. No relevant information could be found about this in the web lookups I've done, and I am not sure this is related to the issue I'm facing. I joined a log of today's better battery stats with a pathetic 1h20 of SOT and 65% discharge, a huge count of wakelocks except when I was listening to music, and an apparent faster discharge with the idle phone than when actually used.
The phone is running the latest downloadable Sony firmware 47.2.A.10.107.
Of course, factory reset was tried with no amelioration and I tried to contact directly Sony which have basically no willingness to help or investigate.
Anyone would have a clue about this?
Thanks,
Alexandre
Do you use Google Now (google assistant) - NlpWakeLock
If not, disable it and see what happens.
This little phone I have for battery life and for banking/authenticator/etc. Not for work. So I have disabled most things I do not need (adb uninstall) - so the battery is quite good on standby.
Thanks for the reply. Unfortunately, as I don't use GoogleNow, the whole Google App is already disabled...
I'll try and do some adb uninstall and will keep you posted
alexounet2 said:
Anyone would have a clue about this?
Click to expand...
Click to collapse
Looking at the bbs stats. The first thing I noticed is that your wifi is on all the time. Try turning it to only when awake and disable the wifi scanning in locatin settings.
RIL wakelocks are on because you have poor signal, it's the number of handhakes your phone does with the local cell tower and if you have bad signal, it gets higher.
Some providers offer home 4g boosters for your home or 'calls over wifi', either of these would reduce your battery usage.
My phone has been flawless (2-3 days on battery when I don't play games) but suddenly it started behaving like described in the original post.
It has 1 day life now and I haven't found the reason for this change. I have removed all recently installed apps, removed all unnecessary apps (including Facebook app), disabled running in background for some (like Messenger), there was no firmware update at that time. Still something is eating up the battery. SmartPanel tool shows that 58% of battery is Unaccounted (next is display and Google Services). I have not done the factory reset yet because I need fully configured phone right now.

Categories

Resources