yashsingh1/xdaforums huggingface dataset:
[ONE Themes and Apps] rsxelrate:
This fix was working great for a while, until now.

Now Google Play Services is crashing every 20 seconds:

[CRASH] com.google.android.gms threw java.lang.IllegalArgumentException

java.lang.IllegalArgumentException: Wake lock not active: android.os.BinderProxy@dec42be from uid 10013

More relevant crash location:

at android.os.IPowerManager$Stub$Proxy.updateWakeLockWorkSource(IPowerManager.java:500)

at android.os.PowerManager$WakeLock.setWorkSource(PowerManager.java:1191)

I also wasn't able to fix with updating the OS, flashing a new .zip, and I can't seem to Disable / reinstall Play Services.

Edit: Update: Was able to reinstall Play Services

Was able to uninstall Play services finally by disabling Android Device Manager as an Device Administrator.

Then, you are able to Force Stop, Uninstall Updates, Disable (reloading the stock Google Play service).

Google Play Store will not work immediately, wait a few minutes, then update Play Services again.

Battery drain is better than a crash notification every 10-30 seconds...
[ONE Themes and Apps] simpsonr:
I've been on 7.5.71 of GPS and have had the same issues. Last night however I cleared data and cache on GPS and haven't had a crash since. We'll see.
[ONE Themes and Apps] rsxelrate:
"cleared data", meaning you wiped your phone?

I've been trying not to resort to that.
[ONE Themes and Apps] simpsonr:
No.. only cleared data on Google Play Services.
[ONE Themes and Apps] rsxelrate:
Seems to have fixed it!

Many thanks to you, fine sir.

---------- Post added at 04:19 PM ---------- Previous post was at 04:13 PM ----------

Dangit, I spoke too soon. Worked for 5 minutes without a crash, now starts to crash again.

Was able to uninstall Play services finally by disabling Android Device Manager as an Device Administrator.

Then, you are able to Force Stop, Uninstall Updates, Disable (reloading the stock Google Play service).

Google Play Store will not work immediately, wait a few minutes, then update Play Services again.
[ONE Themes and Apps] simpsonr:
Darn, sorry to hear. Anyone else having GPS crashing issues?
[ONE Themes and Apps] DjDiabolik:
From today i have found autoupdated the PlayService to 7.5.1............ i don't have crash........ but i need to know if the Battery Drain has been resolved and if whit this version the CM12s going in deepsleep whitout any problems.

If not when there's will be released the MOD Version ?
[ONE Themes and Apps] quadjacks:
This is such a noob/boob question so I apologize in advance... Which is the simplest way here?
[ONE Themes and Apps] jenna.lenna:
I have Google Play Service v. 7.5.71 on KitKat 4.4.4. Wakelock seems to still be there.. I had been blocking it with Privacy Guard but this new version began causing crashes left and right every few seconds of phone use. Without Privacy Guard, wakelock persists. Hoping an updated modded version comes out soon.
[ONE Themes and Apps] dannieloco:
My phone just updated to v7.5.71 today and the wake lock is back. Hope it's being worked on. Before Calkulin made this zip, there was a way to permanently keep Google Play Services from Updating automatically. I forgot where that was posted.. anyone know? Id like to keep using the older version with no wake lock that is posted on the OP here.
[ONE Themes and Apps] phatkid01:
The only thing that worked for me was to disable it as a device administrator uninstall then flash the one from this post and it hasn't updated yet
[ONE Themes and Apps] Ok_Kaleidoscope5109:
Its not a CM11 problem. It was a CM11 and CM12 problem. They fixed it in both branches. The problem is most people don't build their own CM11 builds, so the build bots have stopped for some time. If you are on a build older than March 21st (both CM11 and CM12), you likely still have this bug.
[ONE Themes and Apps] dannieloco:
Can you give more info about how to do this? disable it as a device admin? uninstall using titanium backup?
[ONE Themes and Apps] adinkwok:
Now this is very weird. The fix didn't work for me either!!

Until today.

2 days later, I had deep sleep with no drain. I had 200 minutes of screen on time (3h20m) with 36% left.

These are my battery stats at the time. Just wait a few more days and it should "kick in".

[IMG="asdf"]https://i.imgur.com/6RB0WrK.png[/IMG]
[ONE Themes and Apps] DjDiabolik:
According to my Last reply here:

I have now watched and it's been upgraded to 7.5.71.........the Config App of Boeffla kernel confirm to me (for now) thay my OPO goes in DEEP SLEEP whitout any problems and whitout any privacy setting.

I continue to WATCH my OPO don't upgrade the APP automatically for ever........ i have this problems whit stock COS12s and stock Oxygen.... the APP there's been upgrade automatically only if my OPO it's connect to CA charger........ strange.
[ONE Themes and Apps] phatkid01:
Go to security/device administrator/ uncheck android device manager. Now go to settings/apps/all/Google Play services and you should be able to uninstal/ uninstall updates, once you do that you can reboot and flash older version I went with the 7.3.29 430 for my device n900t T-Mobile note 3 480 DPI if it helps hit thanks ?
[ONE Themes and Apps] maz.b:
My phone is bootlooping with "YNG1TAS0YL".

Got the One Plus One, CM12.1 nightly.
[ONE Themes and Apps] closee91:
My phone will NOT go to sleep. Idk why. I've installed caulkins apk. I've disabled keep awake and wake up AND I've disabled Google plays system update thing when screen is off with servicely. I don't know what else to do...
[ONE Themes and Apps] XDAMaxe:
what do you think about modding your framework-res.apk like described here?

It's way more effective cos it cures the issue at its root.

And btw: check your problem exactly; maybe it's not caused by the issue discussed here, there are lotsa reasons for "my phone doesn't go into deep sleep".

First to answer: Are you on cm11 or cm11 based rom ? What does bbs say ? is gps the cause for your immense wl ?
[ONE Themes and Apps] closee91:
I'll try that. It sleeps but barely, I'm on Candy 5 ROM. I think that's 12.1 based isn't it?
[ONE Themes and Apps] adinkwok:
I'm positive that that fix is for COS12, not CM12.1. That is probably why you are bootlooping.
[ONE Themes and Apps] maz.b:
Would there also be a fix comming for CM12.1?
[ONE Themes and Apps] dannieloco:
Use trickster MOD to determine if its going to deep sleep.

All you have to do is flash this zip on the OP and then give it time to settle it. It took about 1 hour before my phone started to sleep. Just make sure it doesn't update to the latest Play Service app.

---------- Post added at 01:13 PM ---------- Previous post was at 01:05 PM ----------

works! thx!
[ONE Themes and Apps] XDAMaxe:
If your cm11/cm12-based rom is built after March 2015 then you won't need neither fix nor modded framework.

So if wl/no deep sleep persists you have to look at bbs partial wakelocks. And check wakelock detector for wl triggers to focus the cause. I guess your phone wants to sync all the time (known apps: facebook, push mail services and so on)
[ONE Themes and Apps] closee91:
It is built after march. But I look at the permissions for Google play and its still allowing it to wake up all that much. I'll post the screenshot and bbs dump here at the end of the day. Idk what's going on...
[ONE Themes and Apps] XDAMaxe:
That's pretty fine. Allowing permissions is only one side, it comes to bad if this permissions will be used nearly all the time. So let's see...
[ONE Themes and Apps] closee91:
Here's a screenshot of my bbs and a link to my bbs dump

https://docs.google.com/file/d/0B2zBuxe-QvzgSUZZOFlSWVRvZnc/edit?usp=docslist_api
[ONE Themes and Apps] adinkwok:
No because the framework-res.apk has changes every nightly. The best solution for people that update their roms more than once a month would be to use apps to prevent the wake-ups.
[ONE Themes and Apps] maz.b:
Which app? I got now Amplify installed so, and i also tempered SystemUpdateService
[ONE Themes and Apps] Ok_Kaleidoscope5109:
If you're updating your ROM more than once a month, it means the fix has already been implemented. You don't need to address SystemUpdateService anymore if using a ROM that uses the CM Gerrit past 21-MAR.
[ONE Themes and Apps] jenna.lenna:
Thank you, I followed your steps and hopefully it sticks. If I re-enable device manager will google play auto-update again? Must I keep this option ticked off?
[ONE Themes and Apps] adinkwok:
Ah yes, I totally forgot. CM did implement a fix for the wakelock.
[ONE Themes and Apps] closee91:
I think I finally got my phone to deep sleep! Is this normal? Its lost like 2% just from being in sleep in like 2 hours I think. Idk. I might recalibrate it
[ONE Themes and Apps] phatkid01:
I think it will update if you re-enable, I may be wrong tho
[ONE Themes and Apps] XDAMaxe:
Nice.

In your former post alarm/calendar wl are massive (but now it seems that you got rid of them)

At that point you are alright imo and have to finetune with disable service, my android tools,autostarts,system tuner and AutoSync Account Activator to deal with all unwanted syncs, pushs, activities,broadcasts,services and providers which make life hard...

But finally you won't get better drain rates than 0.2-0.5%/h imo (depending on your individual needs and settings)
[ONE Themes and Apps] closee91:
What's the best one to deal with unwanted syncs? Thanks again for your help!
[ONE Themes and Apps] XDAMaxe:
you have to figure out yourself because it all depends on what you want.

Sync periods of google can be handled with AutoSync Account Activator, but fb idk.

I personally use all of the above mentioned apps, in addition app ops (but idk if cm12/lp still has it) to set certain app permissions to 'off', i.e. for google play services 'stay awake' and 'always in foreground' to OFF. same with other apps/permissions (i.e. location).

App ops is for basics, the other apps are for 'deep tuning' so always make a nandroid or your phone might get stuck or metamorphed into an itoilet :p

Hint: don't do anything you don't know about and read read read to make familiar with things (hey it's like in real life), i.e search for wakelock thingies and batt saving on xda or other forums - it will help a lot to understand.

Enjoy!
[ONE Themes and Apps] closee91:
Thanks so much!!! I'll do that. One more thing :p , does undervolting your phone save any battery life?
[ONE Themes and Apps] dudas89:
As far as I've seen and experienced myself, it does not improve it that much, but it helps keeping the cpu temperature a little lower, maybe. I've mine undervolted -60mV, that's a safe value. I've tried lower values, like -80mV or even -120mV, but with no visible effects on battery savings. And this values caused some instability on touch screen. This is just my experience tough.

Btw, I just installed this wakelock fix today and I'm enjoying it on CM12S. The %/hour has been reduced (using BetterBatteryStats). Thank you!
[ONE Themes and Apps] closee91:
I think I might just need a replacement battery.
[ONE Themes and Apps] XDAMaxe:
it's very device specific and i.e for the samsung galaxy phones there are quality levels for each single phone (that's no lie, search for ASV level - each phone has a different one) which is responsible for the ability to overclock (oc) or/and undervolt (uv). Therefore no one can give you the ultimate recommendation for your phone - you'll have to make it alone.

Same again: you have to read in your phones forum what is possible and what can be achieved in general.

My 2 cents: for daily and reliable phone usage forget it, cos you have to spend hours and hours and you'll get 1-5% more power or 1-5% more batt and maybe an unstable phone with weird behaviour and - main thing for me - you'll never know if your phone will be harmed on a long term period. But find out yourself, maybe you like such things.

Your deep sleep is perfect, so with a bit (be slow, better understand slowly then doing all you don't really understand at full speed - you'll regret for sure) fine tuning step by step you can optimize your phone more and more (and by the way your knowledge - maybe to help others).

Enjoy !
[ONE Themes and Apps] closee91:
Thanks a lot! My phone does seem to be dying fast still. Maybe its just me being paranoid lol. It I think the only problem I can think of is I need a new battery
[ONE Themes and Apps] XDAMaxe:
If your phones batt is replacable it should be no prob but to be sure run some batt stress tests (imo antutu has this but haven't used it beforel
[ONE Themes and Apps] closee91:
I'll test that out and let you know. Once again, thanks!!
[ONE Themes and Apps] S1611:
Getting Following wakelocks, any work around this problem?
[ONE Themes and Apps] amoutie:
Maybe you even haven't read the topic of the thread... Use the fix in the thread or Privacy Guard on CyanogenOS.
[ONE Themes and Apps] S1611:
May be you didnt read my post. Google play service version here is 7.3 and mine is 7.5, hence I asked.
[ONE Themes and Apps] highdiver_2000:
I think Google 2fa auto sign on is performed by Play Services. Maybe for search
[ONE Themes and Apps] marwanpro:
Nice but I use the solution with the .sh script in the init.d directory
[ONE Themes and Apps] closee91:
Uninstall Google play services updates then install the OP .zip
[ONE Themes and Apps] naudmick:
.sh script in the init.d directory

Place file in etc\init.d\fixUpdateService.sh with Rootexplorer.

thank tamirda for script !
[ONE Themes and Apps] closee91:
This fixes the Google play bug?
[ONE Themes and Apps] ocd_amp:
This fixes the bug for Good. The bug is not in Google Play. It is in your ROM.

http://xdaforums.com/showpost.php?p=60870224&postcount=586

Doing scripts, or Mod your framework. Both will take the same amount of time, but Calkulin's method will fix it where it should be fixed. The bug is in the ROM, not Google Play. Good luck :)
[ONE Themes and Apps] topbasework:
Will work on touchwiz rom?
[ONE Themes and Apps] closee91:
I tried copying it to the folder but it won't let me. It says its read only. Any fix?

---------- Post added at 10:43 PM ---------- Previous post was at 10:22 PM ----------

Never mind. Used root explorer, all good :)
[ONE Themes and Apps] $ideWinder:
C:\Users\Erin\apktool> java -jar apktool.jar b framework-res
I: Using Apktool 2.0.0
W: Could not find sources
I: Checking whether resources has changed...
I: Building resources...
invalid resource directory name: C:\Users\Erin\apktool\framework-res\res values-
mcc9460-mnc9000
invalid resource directory name: C:\Users\Erin\apktool\framework-res\res values-
mcc9466-mnc9999
invalid resource directory name: C:\Users\Erin\apktool\framework-res\res values-
mcc9724-mnc9999
invalid resource directory name: C:\Users\Erin\apktool\framework-res\res values-
mcc9998-mnc9999
Exception in thread "main" brut.androlib.AndrolibException: brut.androlib.Androl
ibException: brut.common.BrutException: could not exec command: [C:\Users\Erin\A
ppData\Local\Temp\brut_util_Jar_880824079118418154.tmp, p, --forced-package-id,
1, --min-sdk-version, 19, --target-sdk-version, 19, -F, C:\Users\Erin\AppData\Lo
cal\Temp\APKTOOL3056614386940660409.tmp, -x, -0, arsc, -S, C:\Users\Erin\apktool
\framework-res\res, -M, C:\Users\Erin\apktool\framework-res\AndroidManifest.xml]

at brut.androlib.Androlib.buildResourcesFull(Androlib.java:458)
at brut.androlib.Androlib.buildResources(Androlib.java:396)
at brut.androlib.Androlib.build(Androlib.java:285)
at brut.androlib.Androlib.build(Androlib.java:256)
at brut.apktool.Main.cmdBuild(Main.java:225)
at brut.apktool.Main.main(Main.java:84)
Caused by: brut.androlib.AndrolibException: brut.common.BrutException: could not
exec command: [C:\Users\Erin\AppData\Local\Temp\brut_util_Jar_88082407911841815
4.tmp, p, --forced-package-id, 1, --min-sdk-version, 19, --target-sdk-version, 1
9, -F, C:\Users\Erin\AppData\Local\Temp\APKTOOL3056614386940660409.tmp, -x, -0,
arsc, -S, C:\Users\Erin\apktool\framework-res\res, -M, C:\Users\Erin\apktool\fra
mework-res\AndroidManifest.xml]
at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.jav
a:419)
at brut.androlib.Androlib.buildResourcesFull(Androlib.java:444)
... 5 more
Caused by: brut.common.BrutException: could not exec command: [C:\Users\Erin\App
Data\Local\Temp\brut_util_Jar_880824079118418154.tmp, p, --forced-package-id, 1,
--min-sdk-version, 19, --target-sdk-version, 19, -F, C:\Users\Erin\AppData\Loca
l\Temp\APKTOOL3056614386940660409.tmp, -x, -0, arsc, -S, C:\Users\Erin\apktool\f
ramework-res\res, -M, C:\Users\Erin\apktool\framework-res\AndroidManifest.xml]
at brut.util.OS.exec(OS.java:89)
at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.jav
a:413)
... 6 more

I keep getting this error while compiling the framework-res.apk.Can't find a solution anywhere.Any help would be appreciated
[ONE Themes and Apps] auerbach:
thnx for great work

always use your gapps with all roms
[ONE Themes and Apps] XDAMaxe:
what os are you on ? try win 7 or 8 ( I had excactly this on win xp) if you set up all other instructions exactly like described.
[ONE Themes and Apps] $ideWinder:
On Windows 8.1 . I have issues only with the framework-res.apk .I have successfully decompiled and recompiled other apks like whatsapp.
[ONE Themes and Apps] XDAMaxe:
weird, I made it on a win7 notebook, so if you have no hurry I can (try to) mod your framework-res.apk for you tomorrow if you attach it here
[ONE Themes and Apps] ocd_amp:
Your error is caused because it is trying to Decompile "Resources" - To avoid this, try using the -r parameter.

apktool d -f -r framework-res.apk

Delete your framework-res folder in Users directory. Decompile again with the parameter I stated, change values, then recompile.

Make sure you got aapt.exe in the same path as your apktool directory.

Make sure your apktool is in your system "Path" parameters. Google "how to include a program in System Environment Variable" if you are on Windows.
[ONE Themes and Apps] jonovw:
The patched framework doesn't seem to be working for me on OxygenOS. I've tried both making it myself and flashing the .zip someone uploaded here. I've tried factory resetting as well.

Edit: it had one hour wake lock this morning, but it seems fine now.

Edit 2: The wakelock has come back after a reboot.
[ONE Themes and Apps] $ideWinder:
Here you go
[ONE Themes and Apps] joger_:
Does this mod fix the issue with Google Play services randomly stopping?
[ONE Themes and Apps] XDAMaxe:
I followed all the instructions and run all again with the additional hint from ocd_amp but failed too ... same errors like you had.

Weird, everything works fine with my own framework-res.apk, I doublechecked and it still works...

maybe ocd_amp has an idea

sorry that I cannot help
[ONE Themes and Apps] Gamm86:
No.
[ONE Themes and Apps] davebugyi:
Well, actually if the FC is caused by a new version (e.g. 7.5.XX), then it does.
[ONE Themes and Apps] Gamm86:
"True" but then again, without a logcat it's a wild guess as it could be caused by dozens of other reasons.

I only wanted to point out that flashing these Gapps isn't a "general fix for Google play services FC" . Also, this isn't what this topic is all about. Therefor a simple "No" I thought was sufficient enough for the bloke to start looking elsewhere for a solution to his problem. ;)
[ONE Themes and Apps] xn0live:
kitkat

i have flash the version but if i show ti BBS it have oo other wakelock that called

fingerprint scanner local

what is that for a wakelock and how can i fixed it
[ONE Themes and Apps] HellSassa69:
Can someone please provide a clear instruction for me:

I am on cm12s from the OTA and have huge problems with battery drain due to the wakelock and I get constantly this "play services have stopped" poppup. The phone is pretty much unuseable as I always have to carry a power bank around with me.

Does this fix the issue?

If so what do I have to flash? The framework or the play services from thr thread?
[ONE Themes and Apps] MaluNoPeleke:
Is there a new flashable zip file for the 7.5 release?

The init script doesn't work for me.

Thanks
[ONE Themes and Apps] core720:
Update google service patch?
[ONE Themes and Apps] Dynomia:
Any update? I have the 'keep awake' disabled with AppOpps for now.
[ONE Themes and Apps] zwaid:
Update for Google Play Services 7.5? Would be nice
[ONE Themes and Apps] hurda:
Thank you for your tutorial!

Using Calkulins and your directions and the hint regarding reenabling SystemUpdateService from here I fixed this bug in less than five minutes!

One remark:

This command would generally zipalign the original APK, not the rebuilt one in the \framework-res\dist\ folder. I almost made that mistake. :D

Thanks again.
[ONE Themes and Apps] jonovw:
Is the patched framework-res.apk working for anyone on Google Play service 7.5.X? I'm still having wakelocks from SystemUpdateService on OxygenOS.
[ONE Themes and Apps] sash89:
I am on euphoria os latest and google play services is draining...and most of all my apps are using mobile radio active draining...what can ido guys?
[ONE Themes and Apps] kurokirasama:
Thank you very much, thia fixed the problem.

Regards

Enviado desde mi GT-I9100 mediante Tapatalk
[ONE Themes and Apps] ocd_amp:
Yes you need to take the Rebuilt APK, then Zip align it, giving it a new name, then simple delete the old one, and rename your new Zipaligned apk once more, and push it to your device.
[ONE Themes and Apps] HellSassa69:
What is your experience?

With the original play services and the latest Cyanogen 12S the phone is totally unusable because of the short battery life (approx 8hrs).

Is this problem known by OnePlus? Are they working on a fix? Really anoying to be always locked to a power outlet and destroying the built in Battery this way.
[ONE Themes and Apps] quadjacks:
This remains unanswered, can I have a little help please!!?

Which is the simplest way here?
[ONE Themes and Apps] ocd_amp:
Modded framework - If you are on the Same ROM as Calkulin

Instructions - For Cyanogenmod based Frameworks for Kitkat 4.4.4

Google Play Services - Not a solution because Play Store will update Google Play Services automatically unless you create a Folder in /Data/App or where ever your Play Services - with the same File name as your Play Services apk - so if your Play Services APK is called

com.google.android.gms-1.apk ::: You will create a folder named com.google.android.gms-2.apk - This will prevent updating your Google Play Services - However, Google Play Store will still download it into your Cache folder everytime it checks for an update.
[ONE Themes and Apps] Takamoto:
Hello,In first thanks [MENTION=1188493]Calkulin[/MENTION] for your great work..then I have a question..

I'm on custom rom jb 4.1.1 (with google play service 7.3.29/034 dpi) and I'd like know If I can flash your modded google play service in list on first post..If yes I don't understand what must I do in /system..sorry for my noob question..
[ONE Themes and Apps] uansari1:
Is there a modified GPS 7.5.71 available? The app automatically updated and the wakelock is back with a vengeance.
[ONE Themes and Apps] 76slash:
:good: ~ Thansk alot ~ :good:
[ONE Themes and Apps] Genericxx:
May be just placebo, but on the latest versions of gps it feels like you will get more wakelocks and drainage if you block autostart/keep awake/wakeup for gps rather than allowing them. I was accustomed to deny those things from the past, not sure if it wouldn't be better to allow them full. Anyone else got that feeling?
[ONE Themes and Apps] uansari1:
Anyone? Is Calkulkin still working on this?
[ONE Themes and Apps] Hopie:
i had the same wakelocks with this fix..:confused:

flashed 480dpi
[ONE Themes and Apps] Hopie:
cant edit my post.. here screenshot
[ONE Themes and Apps] dannieloco:
Guys just use this older version. I followed these instructions and it locked my play services so it won't update anymore.. kind of a legit fix for now, as I don't see any obvious diff between the new and older play services..

My phone always goes into deep sleep

http://xdaforums.com/showpost.php?p=61014694&postcount=628
[ONE Themes and Apps] Hopie:
i uninstalled the update.. reboot to recovery, flash the fix and reboot.. but few time later, it updated to newer version