yashsingh1/xdaforums huggingface dataset:
[Nexus 5 General] ocd_amp:
CM needs to put out a patch for everyone affected by CM and CM "Based" builds. This includes ROMS like SLIM, Carbon, etc. Not just for CM 12 but CM 11 as well. Because somewhere in the ROM there is code that Disables the SystemUpdateService, and I have not been able to find it. I have looked everywhere and my guess is that it is in an SQL or JAR. However, A dev here has taken the wakelock out of Google Play Services and he can be thanked here.

http://xdaforums.com/oneplus-one/themes-apps/mod-google-play-services-update-wake-t3078082

Also, there is news that Google is rolling out a new version of Google Play Services, and the wakelock is present there as well. However it seems that this is a ROM issue with Cyanogenmod based ROMS. My theory is that Google is trying to kill Custom ROMs and forcing everyone to either stick with their version of Android, or Carrier/Manufacturer Stock - Both of which work fine and do not have any problems with Google Play Services.

So I can conclude this is a CM Issue, and there is no OTA or Flashable zip as of yet for CM 11 users. VERY frustrating indeed. Meanwhile, please check the link above for a fix. The Dev states he will update the APKs as they are released by Google.
[Nexus 5 General] gyoung:
Anyone tried the latest version of Google Play service apk 7.3.27 (1857062-438) ? It worked perfectly for me. I had 7.0.99 before this and the wakelock was terrible. Try and thank me later :good:
[Nexus 5 General] Alcolawl:
Yeah, I can confirm there's no battery drain, at least for me, with Google Play Services 7.3.27.
[Nexus 5 General] ocd_amp:
Apparently the wakelock issue is still there with the newest one as well. Has anyone checked Calkulin's thread?
[Nexus 5 General] pittnuma:
I tried the Calkulin update and get an unfortunately google services has stopped.

On cm12.1 17th

Did a full reformat aswell.
[Nexus 5 General] avalanch:
Worked for me too.. Thanks for suggesting it.
[Nexus 5 General] Ken C:
Hey guys, figure I'd add what seems to have worked for me. I tried the script with no luck. Tried the 7.3.27 play services apk. But then I kept getting an update or sign in message. Took a look at my battery usage and Google + was just running like mad. Unistalled G+, kept the play services 7.3.27.and it's gone. Unplugged the charger at 10:30am and at 4:22 my battery is at 72%. Can't say it'll work for everybody but it's working for me so far. BTW I'm running xTraSmooth5.0 and the latest code blue kernel.

Edit :well scratch that, took 30 minutes or so but the dang update message showed again. Flashed Caulkin's moded play services and haven't gotten back yet. I'll let ya'll know if it changes.
[Nexus 5 General] sepolevne:
z1c - amami

method 1 & 2, no go

method 3, works like a charm

thx a lot m8 :)
[Nexus 5 General] gyoung:
Clear your google play service's cache and data. Sign in again from scratch
[Nexus 5 General] zerosum0:
I've no issues with it, as you can see. Screen on and VOIP on kakao all.the time since I unplugged is what's used it. I think it's best to put these updates where they should be, in the ROM

Sent from my Nexus 5
[Nexus 5 General] FunDionysus:
Google Play Services 7.3.29

Anyone seeing the same issue(s) with Google Play Services 7.3.29
[Nexus 5 General] stewarta:
Exchange server

I am not sure about that given my stock Nexus 5 running 5.01 started to use battery at a rate such that it would go from 100 to 20 in a matter of hours. I panicked and ordered a replacement battery. Then I thought about it and found that PlayServices was using about 60+% of the resources. I found that since Google bundled a lot into that part of the OS, this has been an issue. The solution that worked for me was to go to the Web version of my employer's Outlook exchange server. There I deleted all phones/tablets I had given access to since 2012 (sloppy of me I know). Then I deleted Exchange email account and reinstalled it. I also turned off push sync and now do it manually. The only auto syncing now is gmail, eBay and Fakebook. I am powering off at night.

The day following this tweak the phone went from 100 to 86 by 8:30 pm. On Day 2, battery went from 86 to 60. I am now on Day 3 and from 7:00 am to 11:00 am it has gone to 51 and the system advises it has a 22 hours to go. I also turned of the display's auto settings.

Exchange and and Display now equally used 6% of the battery in the four hours today.
[Nexus 5 General] ocd_amp:
Thanks for your post. A dev by the name of Calkulin located the issue and since then I have modded Cyanogenmod 11 framework-res.apk for the users of the ROMS I am using. It has eliminated any Wakelock issues relating to apps that are using Google Play Services. If I have time I will fix other ROMS depending what they need, will have to check their upstream commits as of recently. I can't say the same for CM12 as I don't use Lollipop and I don't intend to until its been ironed out. The problem was in CM11 framework. So I fixed it.
[Nexus 5 General] stewarta:
[SOLVED] Three days of power

In the past six days, I have gotten three days from each full charge since I made these 'adjustments'.

Here is the first three days usage:

[IMG="N5 Battery Usage"]http://stewartadam.com/nexus5/battery-usage-n5.jpg[/IMG]
[Nexus 5 General] ocd_amp:
You are not alone :p
[Nexus 5 General] Paget96:
I fix script to run on boot :)

I can upload if you want ;)
[Nexus 5 General] Wrapp:
Yes, please [emoji1]
[Nexus 5 General] krugdenis:
Working script for init.d

sleep 60
echo "Disabling SystemUpdateService Battery Drain"
su -c pm enable com.google.android.gms/.update.SystemUpdateActivity
su -c pm enable com.google.android.gms/.update.SystemUpdateService
su -c pm enable com.google.android.gms/.update.SystemUpdateService$ActiveReceiver
su -c pm enable com.google.android.gms/.update.SystemUpdateService$Receiver
su -c pm enable com.google.android.gms/.update.SystemUpdateService$SecretCodeReceiver
su -c pm enable com.google.android.gsf/.update.SystemUpdateActivity
su -c pm enable com.google.android.gsf/.update.SystemUpdatePanoActivity
su -c pm enable com.google.android.gsf/.update.SystemUpdateService
su -c pm enable com.google.android.gsf/.update.SystemUpdateService$Receiver
su -c pm enable com.google.android.gsf/.update.SystemUpdateService$SecretCodeReceiver
echo "Script Execution Successful"
[Nexus 5 General] Wrapp:
Thanks a lot for the script.

I put it into /etc/init.d and gave the permissions 777. But how do I know if it was really executed? Don't see a "Disabling SystemUpdateService Battery Drain", also do not find it in logcat or dmesg...

If I start it manually in kernel audiutor I get a field "executing" with a rolling circle for minutes.

Nexus 5 with Code Blue kernel.

Sorry for the question
[Nexus 5 General] Paget96:
I will copy here, wait

That will not work on boot :)

wait, i will copy here

Here...

Make new file, copy all this stuff inside it, give some name for file, copy to init.d and set perms to all (777

sleep 20

su -c "pm enable com.google.android.gms/.update.SystemUpdateActivity"

su -c "pm enable com.google.android.gms/.update.SystemUpdateService"

su -c "pm enable com.google.android.gms/.update.SystemUpdateService$ActiveReceiver"

su -c "pm enable com.google.android.gms/.update.SystemUpdateService$Receiver"

su -c "pm enable com.google.android.gms/.update.SystemUpdateService$SecretCodeReceiver"

su -c "pm enable com.google.android.gsf/.update.SystemUpdateActivity"

su -c "pm enable com.google.android.gsf/.update.SystemUpdatePanoActivity"

su -c "pm enable com.google.android.gsf/.update.SystemUpdateService"

su -c "pm enable com.google.android.gsf/.update.SystemUpdateService$Receiver"

su -c "pm enable com.google.android.gsf/.update.SystemUpdateService$SecretCodeReceiver"
[Nexus 5 General] krugdenis:
For both of my devices it works ) )
[Nexus 5 General] Paget96:
For me first don't then I think about it, maybe script runs before gp sevices loads into ram, then I added sleep and also " "
[Nexus 5 General] Wrapp:
Still think it doesn't work as init.d script. At least I get no messages when booting my nexus 5, code blue kernel. When I start it manually from the terminal I get messages that some services are enabled (in the shell, but also I'm small up popping messages).

Starting it manually I have the impression it gives me significant longer battery life
[Nexus 5 General] floid180:
how do i know script is running?? i only copy it on the carpet, and set permission as same as image, reboot, but how i know is working?
[Nexus 5 General] Entropy512:
It only occurs in CyanogenMod derivatives.

It happens VERY rarely (As far as I can tell, once per installation) on non-CM-derived custom firmwares and disappears after first reboot. I've seen it maybe once in a year and a half on Omni, and it was right after a fresh install.

Someone in CM decided that they wanted to kill even these rare almost-unreproducible situations back in the ICS days, and started messing with disabling parts of Google Play Services, starting a neverending whack-a-mole nightmare every time Play Services changes their updater mechanisms.

The problem is that Play Services, when component names change, doesn't take kindly to having only some of its components disabled and goes bat**** insane, and the end result is this crap that plagues CM derivatives every time Google changes things related to the updater.

TL;DR - This is just one of CM's hacks behaving badly.
[Nexus 5 General] floid180:
if i use the script, and open "disable services" and SystemUpdateServices still enable!

does the script is running? i use Paget96 script because original didnt work!
[Nexus 5 General] ocd_amp:
I couldn't agree with you more. I have a few words for Cyanogenmod but I'll hold those choice few words back, but I will go ahead and say this. After looking through their code, I believe Cyanogenmod hacks, steals, begs, and borrows, to get their chops out the door as soon as possible. Their game does not seem to focus on quality, rather quantity. It's not so much a matter of what does not work, we can live with that but the fact that they market their product as BETTER than the rest is an over statement. They simply 'forget' to acknowledge known issues or simply refuse to fix them. I find it hard to believe someone developing a ROM and a kernel will not notice the smallest of things ie "Why does the Launcher/Desktop show up before the Lockscreen does everytime you wipe Dalvik/Cache?" My bet is they do notice, they just keep quiet about it and release buggy code anyway without documenting it. Those who develop their ROMS based off CM trees then get the bulk weight of having to deal with supporting their ROM full of bugs which they didn't introduce in the first place. Google is surely to be blamed, and rightfully so, with their never ending beta software (a dev here recently found that Gmail stores passwords in plain text) but Cyanogenmod has shown the deepest lack of professionalism when it comes to handling issues. Supporting a ROM is not the same as fixing bugs. Continually "updating" a piece of software with less important issues while leaving existing and sometimes visible bugs in it is not an Update. If you want a device that does what it is supposed to do, an Android based on Cyanogenmod with Google apps running on it may not be suitable for a professional environment at all.
[Nexus 5 General] Paget96:
Scipt job is to enable it.

On some cm roms (older source) gps have bug that cannot start properly and that enabling going to infinity loop and cause 100% wakelock. Script enable it to stop loop.
[Nexus 5 General] floid180:
im using cm 12.1 last nigthly for falcon, i dont think is old source, or is it?

i just hate play services use so many battery!
[Nexus 5 General] amarty92:
Hey guys!

I have a galaxy s6 on T-Mobile & I'm experiencing severe wakeups by Google play services version 7.3.29 (latest version) - I'm kind of new with these wakelocks since this is the first time I'm experiencing them this severe (1300 wakelocks & counting) would this script happen to fix my issue or? My custom rom is Xetrolite 1.0c within the XDA tmobile galaxy s6 forum. Let me know if I have to supply any additional information. Thanks!
[Nexus 5 General] Paget96:
U can use mine script, work om boot.

See at L Speed thread
[Nexus 5 General] amarty92:
Thanks! Could you post the link to your script?

Edit: found it! Haha, flashed it and phone is on 100%. I'll let you know how it goes :)
[Nexus 5 General] Paget96:
Exactly this is perf/batt mod xd

Btw do u have wakelocks??? :D
[Nexus 5 General] amarty92:
Sadly, yes :(

View attachment 3321070

View attachment 3321072
[Nexus 5 General] sirob71:
I had the drain issue on stock 5.1 and this fixed it totally! :good:
[Nexus 5 General] jbl0ggs:
My Son's Nexus 5 (not modified in anyway) has progressively gotten really bad with battery drain issue. It would get charged to 100% and then after unplugging and 10 mins of use the battery goes down to 10%. It got really bad after upgrading to Lollipop. I have ordered a new battery and now I have to figure out how to install the new battery. Google, of coarse, told me that I'm SOL since it's out of warranty.

Would this script help my Son's Nexus 5? if so, would the steps be? :-

1) Clear Cache/Data for Google Play services

2) Install Script App

3) Run App

Thanks!
[Nexus 5 General] doalittledanse:
Does the script survive after flashing new nightlies? If it doesn't, is there an update.zip for it?
[Nexus 5 General] Paget96:
Can't survive :/

There is a flashable zip, but this is whole mod.

Sarch on google for L Speed mod. :)
[Nexus 5 General] doalittledanse:
I don't want all that other stuff, just the system update enable script.
[Nexus 5 General] chantoine:
Hi,

I think method #3 is not complete.

The script enables com.google.android.gms (services Google Play) SystemUpdate component AND com.google.android.gsf (framework Google Play), though the method #3 exposed in OP forgets about framework.

Could anyone confirm ?

Thanks
[Nexus 5 General] racky29:
For me Paget's script in init.d is the only one that works for me

But I removed the gsf framework code, I don't have a nexus

Been looking for a solution for oneplus one on cm11s

And this did the trick

Don't know whether its the sleep 20 command, or

the "" quotes around the commands. But it worked.

sleep 20
su -c "pm enable com.google.android.gms/.update.SystemUpdateActivity"
su -c "pm enable com.google.android.gms/.update.SystemUpdateService"
su -c "pm enable com.google.android.gms/.update.SystemUpdateService$ActiveReceiver"
su -c "pm enable com.google.android.gms/.update.SystemUpdateService$Receiver"
su -c "pm enable com.google.android.gms/.update.SystemUpdateService$SecretCodeReceiver"

Saved as 95fixservice, perms 755

Thanks Paget,
[Nexus 5 General] Paget96:
Thanks :)

Sleep is there because gps app didn't start at same time as device and init.d script. Then if is script launched before an app there is no effect :)

Without quotes doesn't work for me ;)
[Nexus 5 General] Iced-Earth:
Thanks for this fix.

Is used the file from th OP and put it into /etc/ and set the permission. Afterwards I used Tasker to execute this file at every reboot and till now it seems to be solved.

Thanks!
[Nexus 5 General] saveferris:
I have been getting alot of these alarms .................................... ALARM_WAKEUP_ACTIVITY_DETECTION and ALARM_WAKEUP_LOCATOR

I have 596 and 396 of these alarms........will this script help rectify these ?
[Nexus 5 General] Paget96:
Disable location on the device
[Nexus 5 General] renzo090513:
One question, when i go to Disable Service the box is already checked. I uncheck the box or it is ok that way?

Enviado desde mi hermoza maquina LG-D802.
[Nexus 5 General] dorimanx:
Nice. well done DEV.

merged to LG G2 kernel for LP.

https://github.com/dorimanx/lp_ramdisk_dorimanx/commit/bcb644c75cccd5ec9ae4a00c1eb370d34c5d62d4
[Nexus 5 General] masteril:
[MENTION=2376110]dorimanx[/MENTION] can you please merge it to the kitkat kernel? :)
[Nexus 5 General] dannycellestio:
this means that 3.4 incoming ?
[Nexus 5 General] pmgnet:
This is great news from dorimanx! This battery fix took my Cloudy LP ROM from 60-80% Google Play Services battery drain down to 3%. Slam dunk!

Thanks, Alcolawl!
[Nexus 5 General] migueldbr:
If i understand correctly, we have been blaming google for google play services for wakelocks when it was basically caused by custom roms?lol

Another reason why i like to run stock rooted=p
[Nexus 5 General] Floodland:
No, in the best case it means Google is acting like Microsoft in the Windows golden era.

Stock Android is an empty shell, growing for no good reason, supporting thousands of obsolete hardware, letting old bugs present and obscuring their system with each release.

Google play services is proof of what I am saying, much like Windows update services, waste resources, not allowing the devices to sleep for no good reason, recommending things that you do want when you search, and not allowing useful software to be there (selinux modifiers were removed. Come on why selinux cr*p was included in the system in the first place!).

I am personally evaluating not using google play on my devices anymore: Shame that aptoide is not much better at this point...[/RANT]

At this point, removing Google play/services/related stuff the ability to wake up the device and getting device location works too (aps ops does the job)...
[Nexus 5 General] migueldbr:
What you say is true, but they seem to be adressing that with Android M, with doze blocking wakelocks caused by apps. It's better than nothing lol
[Nexus 5 General] thenessus:
Hi people

I've found a workaround to Google Play Services (especially Gmail) wakelocks - unrelated to the OP or any scripts.

This was done on Cataclysm, stock kernel.

1 - full wipe

2 - Flash ROM ( and SU if you want of course)

3 - wipe internal memory (yes, internal memory. I flash almost daily and never wipe internal memory but only decided to do it now to see if it has any effect just this one time)

4 - wipe cache

5 - boot

Finally, no more Google play / services / Gmail wakelock draining the damn phone.

I had this drain happening in any possible ROM and kernel, be it Cataclysm, CM, CM-caf, Euphoria, Chroma, you name it... but this seems to have fix it. I theorize that some residue information remains on the internal memory and drives Google services crazy.

Screens attached.
[Nexus 5 General] matrixzone:
Thanks
[Nexus 5 General] Zephyr!:
It's already checked in my tab. Is it ok?
[Nexus 5 General] DAN1926:
I've put the script.sh in the init.d folder but it's not running on boot, why?
[Nexus 5 General] v7:
Fixed permissions and owner?

Tapped from my furious dogo ;)
[Nexus 5 General] DAN1926:
Yes of course.

The fact is that if i open it with Smanager and check SU and BOOT options it actually runs on boot but i want to run it without Smanager is that possible?
[Nexus 5 General] v7:
Do you have init.d support on your ROM?

Tapped from my furious dogo ;)
[Nexus 5 General] DAN1926:
Yes I have it! I've tested it already with the 00test script

Maybe i need to edit the script with some lines to make it run on boot?
[Nexus 5 General] v7:
I believe you're using Method 1.Copy the script to init.d folder.Set permissions to 755, set owner to root.shell and Reboot.

Tapped from my furious dogo ;)
[Nexus 5 General] DAN1926:
I did all you wrote but the script is only running at boot with Smanager
[Nexus 5 General] v7:
Then probably you don't have init.d support on your ROM.

Tapped from my furious dogo ;)
[Nexus 5 General] DAN1926:
This is the proof that i have it, runned the test script once more:
[Nexus 5 General] v7:
Can you try the fix in my Sig?

Tapped from my furious dogo ;)
[Nexus 5 General] DAN1926:
I've already tried it but with no luck!

The only fix that actually works for me is the workaround found by Dimitris Psallidas who posted it on external site

These two command lines works for me but i want to use them on boot without tapping the "wakelock fix" app every time a turn on my phone, beacuase it's really annoying.

The commands are:

pm enable com.google.android.gms/.update.SystemUpdateService

pm disable com.google.android.gms/.update.SystemUpdateService
[Nexus 5 General] lucacerio:
You can set tasker to do it

Inviato dal mio Nexus 5 utilizzando Tapatalk
[Nexus 5 General] DAN1926:
Yes, I know but i wanted to know if I could make it run on boot without any app using just the init.d support

I wonder what kind of command Smanager adds to make it possible and i wonder if i could do it on my own, I'm just too curious I know :D
[Nexus 5 General] harish2887:
HI, I am using stock rom 5.1.1 and i am still facing this issues of google play service draining battery almost 15%. I have also tried M preview but still i have this issues.Any suggestions how yo resolve this in stock????:(
[Nexus 5 General] v7:
Have you tried different GAPPS packages?

Tapped from my furious dogo ;)
[Nexus 5 General] harish2887:
I am using stock Android.... how to change gApps in stock ???
[Nexus 5 General] v7:
Not possible :P

Have you tried the fix from the OP?

You'll find another one in my Sig.Try that too

Tapped from my furious dogo ;)
[Nexus 5 General] harish2887:
All the solution require root and the problem is also because of custom ROM.

But i don't have a custom ROM.
[Nexus 5 General] danielkzlai:
Hi everyone. I'm new to all these stuff so I can't understand many terms in the thread, but I've been struggling to learn but this problem is still persisting. I just flashed cyanogenmod 11 and noticed this problem. No other things flashed.

Phone: Samsung Galaxy S3 GT-i9300

OS: Android 4.4.4

I did Method 1, putting the fixUpdateService.sh file into the init.d, still doesn't do anything. I think I tried running it manually on Root Explorer and it worked. But it doesn't run automatically like said. I set permissions to 755

Then I tried to change the (.sh) file and put in )#!/system/bin/sh) because I read that all init.d files started like that. Didn't work.

I tried changing the apostrophes like some people replied, and added (sleep 60), still didn't work.

Things I noticed that were weird: The .sh file always says "Read only file", even when I tried to change the permissions in Terminal Emulator. (chmod 755 I think)

For now, I'm manually enabling SystemUpdateServices using DisableServices.

Please help?
[Nexus 5 General] leo.riv:
[MENTION=4752299]Alcolawl[/MENTION]

Place the fixUpdateService.sh file in the /etc/init.d directory and set permissions to 755 then reboot.

after reboot Run this command ./etc/init.d/fixUpdateService.sh show this

View attachment 3407823

Why ?
[Nexus 5 General] danielkzlai:
Thanks! The script can be run in Terminal Emulator when I type it in, but SystemUpdateService gets disabled again once I reboot after running the script.
[Nexus 5 General] Alcolawl:
Basically means the script isn't doing it's job. Because you don't have the exact UserID of the service you're trying to enable, the script can't identity which service you're talking about essentially. Which ROM is this on? (ROM / Android Version / Etc.)
[Nexus 5 General] leo.riv:
Optimus One ROM by fa1zali

Kitkat 4.4.2
[Nexus 5 General] Alcolawl:
Hmm. Are you running the script manually? If you definitely have the Battery Drain from Google Play, this should work, unless the services are somehow named something different in KitKat. It is also possible the dev included a fix already, considering CM found a similar fix a while back. I'll have to look into this some more.
[Nexus 5 General] leo.riv:
yes I am running this script by terminal emulator. When open play store increase battery dropping.

View attachment 3408366

View attachment 3408367

View attachment 3408368
[Nexus 5 General] bigknowz:
Google Play Muisc

delete