@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.
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 OpsOpen 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.
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.
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.
Hello, I did the changes and it works but then I am getting a pop up that Google play services has stopped continuously, While using my location... Please help me..
java.lang.IllegalArgumentException: Wake lock not active: [email protected] from uid 10015
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)
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)
I don't remember what i did, might have just factory reseted the phone, but not sure
Sorry
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