• Introducing XDA Computing: Discussion zones for Hardware, Software, and more!    Check it out!

[GUIDE][PSA] Google Play Services battery drain fix

Search This thread

Ygor Cortes

Senior Member
Apr 18, 2014
139
23
@timmaaa

Let's just think it through regarding your proposed fix.

Say for example I have a 4pm appointment to get to a client 1 hour away. I'm sitting in my office and working, meaning I'm not playing with my phone. The screen is off. Assuming Google Now can get my location, it knows that I'm one hour away and I need to leave by 3pm to get there on time. Google Now notifies me 15 minutes before I need to leave (2:45 pm) so I get there on time. Now typically at 4pm there's SOME traffic already, so being smart I know I should probably leave by 2:45pm anyway and not 3pm.

However let's say there's a clusterf--- on the highway and it's the first rainy day of the year in California. Native Californians here know exactly what I mean. First day rainy Autumn in October and there's a 5 car pileup that sets me behind 35 minutes. Now I should've left at 2:25pm.

How does Google Now do this? It periodically checks where the hell you are, and what that transit time between your current location is and where you need to be. It then alerts you when that time is up.

Where your fix has a problem: If I need to get this alert, how does my phone get my location if Play Services is unable to wake up?

Where it might not be so bad: Assuming I turn on my phone and play with it every so often, Play Services should be able to get my location when the screen is on. This is because your fix only disables wake ability, meaning Play Services is neutered when the screen off. However, does a screen on event GUARANTEE that Play services will ping for my location and thereby Google Now can act? I don't know. It might, and if it does, as long as you power on your screen every once in a while, Google Now should be able to work properly.

You see what I mean now? So if I were to guess based on my engineering analysis of how Play Services works, for someone who sits in meetings all day, depending on a location based notification to pop up with your fix could be problematic. It MIGHT not be a problem if you frequently fiddle with your phone.

Have I tried this fix?

I tried it for a week or so when I was on business travel. I didn't get any travel cards for going to the airport until it was too late. The parking card was totally wrong and showed where I parked in the morning after I went out for lunch and came back to the office.

Have I concluded that this proposed fix for sure is a problem?

No, but I think my analysis of Play Services is sufficient to tell me this is not a safe fix for me. The best field test would be to carry two phones, one with and one without the fix, and monitor the Google Now cards that show up. Kinda hard for us average human beings to run. I don't have the time nor the resources to perform a serious test.

So anyhow, that's my thoughts. I'm not against you proposing your fix. I'm just trying to point people to a better fix if they're coming in here asking about the 7.x Play Services drain because that's specific to SystemUpdateService and can be solved without messing with any location settings or background behavior of Play Services.

What if I only disable the keep awake option? Do you know exactly what's the difference between wakeup and keep awake? What you said is actually really interesting, thank you a lot!
 

[email protected]

Senior Member
Aug 9, 2015
65
11
Tbilisi
Sorry if I'm being stupid but may I ask you to explain in more detail?

Could not find any AppOps on 6.0.1 (MMB29S) so I installed quickshortcutmanager, and could not quite figure out what you say about it:

Open the app and it should already be in the Activities tab, scroll down to Settings and click on it, that will open up a whole list of different options, scroll down to the App Ops option and click on that, hit the create button at the bottom of the screen.

This is going to add a Settings icon/shortcut to your home screen, click on that and you'll be taken into the secret App Ops section of the settings menu, from there just find Google Play Services and click on it, then disable the Wake Up and Keep Awake options. Reboot phone, no more Google Play Services battery drain.
Google Play Services has lots of different activities under it (like WearableManageSpaceActivity, AdsSettingsActivity, LockscreenActivityPermissionTrampoline, GoogleSettingsLink, ManageSpaceActivity, AutoBackupSettingsActivity, LocakFoldersBackupSettings, IcingManageSpaceActivity, IcingPrivacyActivity, ListAppsActivity, ManageAppActivity, MdmSettingsActivityPermissionTrampoline, TapAndPaySettingsActivity, AddAddressActivity, UpdateAddressActivity, AddInstrumentActivity, UpdateInstrumentActivity, BillingInstrumentActivity, WalletFragmentShimActivity, ChooseAccountShimActivity, BillingMakePaymentActivity, CreateProfileActivity, AcceptLegalDocsActivity, PickInstrumentActivity, ImRootActivity, UdcSettingsListActivity, NearbySettingsActivity, CredentialPickerActivity, CredentialsSaveConfirmationActivity, SignInActivity, FitnessSettingsActivity, PlayGamesUpgradeActivity, FamilyCreationActivity, FamilyManagementActivity, DeleteMemberActivity, PanorameViewActivity, DiscoveryActivity, GcdSetupSettingsActivity, D2DSetupActivity, D2DSourceNfcHandlerActivity, SmartProfileActivity, LocationSharingSelectionActivity, AppInviteActivity, ContextualPeopleSelectionActivity, AppInviteAcceptInvitationActivity, NearbyUxDemiNotificationActivity, NearbyMessagesAppOptInActivity, RegisterProfileOwnerActivity, FirstActivity, CarServiceSettingsActivity, CarHomeActivity, CarHomeActivity1, CarErrorDIsplayActivity, SystemUpdateActivity, CompleteDIalog, UpdateFromSdCardActivity, GcmDiagnostics, FeedbackActivity, PreviewActivity and so on but I could not recognize any of them as App Ops
 
Last edited:

Traace

Senior Member
Mar 13, 2010
439
115
Did they removed Wake Up, Keep Awake, and Auto-Start toggles on 6.0.1? Or i'm just blind, My Play Services drained 2800mAh in two days., however using Servicely now, to block these services while the screen is off
 
Last edited:

dmo580

Senior Member
Dec 29, 2009
2,606
708
What if I only disable the keep awake option? Do you know exactly what's the difference between wakeup and keep awake? What you said is actually really interesting, thank you a lot!

I don't know the difference, but I'll say that this specific thread that was created to address the SystemUpdateService wakelock is not really relevant anymore and to advise people to move on. You really shouldn't be disabling Keep Awake.
 

kmarc33

Senior Member
Aug 29, 2013
163
59
New Jersey
I don't know the difference, but I'll say that this specific thread that was created to address the SystemUpdateService wakelock is not really relevant anymore and to advise people to move on. You really shouldn't be disabling Keep Awake.

Just for clarity: shouldn't disable keep awake as of 6+? I've got a OnePlus One running the latest stock/rooted, and still disable all 3. But the latest stock is 5.1.1.

Thanks
 

neo_styles

Senior Member
Mar 24, 2011
344
91
Los Angeles
When I denied Wake Up, Keep Awake, and Auto-Start in Privacy Guard, Google Play Services started FCing rapidly over and over again and wouldn't stop. Made it difficult to navigate on the phone because it was putting up the modal dialog almost immediately after I dismissed the previous one. Still did it after a reboot. Eventually I allowed Keep Awake, and it stopped FCing. Hopefully it will still help the battery drain.

Sorry to boost this one from the past, but I had the same issue. Keep Awake has to remain on for me as well or I get perpetual Play Services FCs. Not a dealbreaker, but something for other users to take note. This was on a clean wipe and fresh install from stock, allowing each OTA to run its course, ending with the most recent update to COS (S2K1).

BUT...I managed to perform the first section of the OP without root. Maybe the lack of root is causing the issue and/or maybe I need to root and run the second portion if I'm overly concerned with battery drain. We shall find out over the next couple days.
 

karthics4

Senior Member
Aug 1, 2010
129
3
London
about.me
i removed the permissions to wake up and also location but it made my battery life worse. so i went back to old google play and it made it ok
 

benyben123

Senior Member
Sep 22, 2010
1,191
75
Thanks for this guide.

In my case I don't even have KEEP AWAKE and AUTO-START. They are not there.

Is this a problem?

I just disabled keep-awake.
 

atrix4nag

Senior Member
Jul 12, 2011
1,429
221
Maryland
A small question...
if I disable keep awake for GPS and GSF, and auto start for GPS, will I loose whatsapp instant notification? I am not getting Whatsapp notifications, right now. I have to open the app and refresh to get new messages. So just checking what could be the issue.

Sorry, if its irrelevant to the topic.
 

bigben14

Senior Member
Oct 6, 2013
140
11
i did what you said and now i can't open my phone : it does boot but then i only see the wallpaper and i can't touch anything and on the notification bar there is the no sim card icone
any solution (besides factory reset)
 

dummyusr

New member
Feb 19, 2016
3
3
boot loop here too, i'm using screen pin lock.

I can type pin but when it's OK it hangs, or if i push emergency call it hangs, if i idle it reboots.

BEWARE!

PS: android 6 CM 13
 
Last edited:
  • Like
Reactions: alexevans1120

chrigist

Member
Oct 21, 2010
6
1
Amplify blocking "Icing" wakelock was the problem for me

java.lang.IllegalArgumentException: Wake lock not active: [email protected] from uid 10015
Also this happened to me from one day to another withour changing anything, mostly when starting chrome or gmail. But I was able to solve the problem, which was in my case: I had the Icing wakelock disabled with Amplify (I had it set to a 7200 seconds interval). When I turned the wakelock blocking off the problem disappeared. Good luck guys!
 

ringen00

Senior Member
Oct 18, 2006
222
34
Work around that disables wake locks in the privacy guard isn't really helpful when using AutoLocation!

Big Problem here!
Since a couple of days the GPS icon stays visible and the device is very hot.
As much as I could investigate this comes from Google Play/Services because I could see a high battery usage in the battery and location panel of the Android settings.
The described issue happens randomly/over night ...
When I force close the Google play app the icon goes away.
I deleted the data and uninstalled the updates of Google Play - seemed to help for a while. Now the app is back to it's newest version -problem persists!
Found a work around that disables wake locks in the privacy guard but this isn't something really helpful when using AutoLocation, RIGHT?!

Please help me with this!
It happens on two OPO's running CM 11.0 05Q
I'm rooted.

Thanks! :)
 

TeddySika

Senior Member
Jul 28, 2016
64
3
Jakarta
i did what you said and now i can't open my phone : it does boot but then i only see the wallpaper and i can't touch anything and on the notification bar there is the no sim card icone
any solution (besides factory reset)

im having this too. please help

---------- Post added at 05:11 AM ---------- Previous post was at 05:07 AM ----------

i did what you said and now i can't open my phone : it does boot but then i only see the wallpaper and i can't touch anything and on the notification bar there is the no sim card icone
any solution (besides factory reset)

how you fix this issue?
 

Top Liked Posts

  • There are no posts matching your filters.
  • 372
    If you're running a recent CM based or aosp ROM you've most likely encountered some pretty severe battery drain from Google Play Services (or Android OS as it sometimes shows up as). Below is a procedure that will halt the battery drain, but will not affect the running of your device.

    Enter Privacy Guard through Settings/Security or Settings/Privacy, then click Advanced or Show Built-In Apps (depending on which ROM you're running). From here you can select Google Play Services and deny the Wake Up, Keep Awake, and Auto-Start options. Reboot phone. This should drastically reduce the amount of battery that Google Play Services and Android OS consume.

    8e06eb5829fa52bbe2a195580211696d.jpg


    If you're on a ROM that doesn't include Privacy Guard or App Ops as standard you need to take a slightly different approach. Download this:

    https://play.google.com/store/apps/details?id=com.sika524.android.quickshortcut

    Open the app and it should already be in the Activities tab, scroll down to Settings and click on it, that will open up a whole list of different options, scroll down to the App Ops option and click on that, hit the create button at the bottom of the screen.

    This is going to add a Settings icon/shortcut to your home screen, click on that and you'll be taken into the secret App Ops section of the settings menu, from there just find Google Play Services and click on it, then disable the Wake Up and Keep Awake options. Reboot phone, no more Google Play Services battery drain.

    14062f959709b826164520e67fc7de94.jpg


    Please note: If you rely on your location being updated frequently then this method might not be right for you. This method disallows Google Play Services from waking your device every minute to obtain your location and Google Now cards are affected as a result. All other Google services should function normally.

    aDlDoZJ.jpg

    Donate To Me

    Transmitted via Bacon
    12
    Here's a true fix for the system update wake lock, so no special apps or even root needed

    http://forum.xda-developers.com/one...mod-google-play-services-update-wake-t3078082
    12
    This guide is a little excessive, the biggest battery killer for that app, especially if you use Google Now, is the wake ups permission, so denying just that will fix most of the battery drain. If you want to go the extra mile, denying the keep awake permission also which fix the other minor part and none of these fixes require root

    EDIT: Just noticed you said AOSP, which doesn't have the wake up or keep awake permissions to deny IIRC, so what I said only applies to the CM ROMs
    8
    This guide is a little excessive, the biggest battery killer for that app, especially if you use Google Now, is the wake ups permission, so denying just that will fix most of the battery drain. If you want to go the extra mile, denying the keep awake permission also which fix the other minor part and none of these fixes require root

    EDIT: Just noticed you said AOSP, which doesn't have the wake up or keep awake permissions to deny IIRC, so what I said only applies to the CM ROMs

    While this may seem excessive, the fact is it works. My personal experience was that after changing the things mentioned that don't require root I still had Google Play Services draining my battery. As with anything though, mileage may vary. I'll add a note that the root section may or may not be required.

    Forgive me for using a term (AOSP) that most XDA users associate with anything that's CM based. While it may not technically be 100% correct, it seemed to be in keeping with the vernacular used by your average XDA member.

    Thanks for your input, I appreciate it.

    Sent via Bacon
    5
    Hi Everyone,
    I did a gentle thread cleaning to remove some off topic posts. So it looked like there were a couple of things that were going on. So for starters, this thread is not a "what can we do to fix the battery drain" thread. It is about a very specific set of steps to fix a very specific problem. There maybe lots of other solutions to this problem as well, but they should get their own threads. Otherwise this thread will become a confusing jumble of solutions that will be very very very difficult to follow.

    I think it should be allowed to ask about other solutions and propose ways to improve this method, but it will be up to the OP to decide to answer the questions and/or make updates to the guide. Lastly...not every disrespectful post was meant to be that way, people have different ways of communicating and with out the face to face interaction, it is really easy to take things the wrong way. Its always best to give the benefit of the doubt.

    Thanks!