yashsingh1/xdaforums huggingface dataset:
[Nexus 4 Q&A, Help & Troubleshooting] Dominik916:
Recently I changed my rom on S2 and noticed much more battery consumption. In BBS most of all was ALARM_WAKEUP_LOCATOR. I changed back to my old rom and was the same :(. Now I disable WiFi location and this wakelock doesn't occur.

Why this function in one phone works well and in another one causes more battery consumption?

In my i9000 I have enable WiFi location and this process doesn't wake up the phone...
[Nexus 4 Q&A, Help & Troubleshooting] Peterg91:
Man, you can't be normal quoting the topic-initial messsage long as hell, just to give your 1 sentence credit.. :D can't believe my eyes..
[Nexus 4 Q&A, Help & Troubleshooting] CVAngelo:
Just saw this thread today and had exactly the same reaction when I saw that post. I was just about to reply that it's not necessary to quote the ENTIRE OP post....then I saw your message. Cracked me right up.

---------- Post added at 07:08 PM ---------- Previous post was at 06:50 PM ----------

For anyone who's still having massive battery drain problems due to your phone not sleeping when the screen is off, here is what I did to almost eliminate the problem:

1. Disable the Wi-Fi & Mobile Network Location (as per OP)

2. Download the app called "Disable Service" from Google Play and in the system apps under Google Play Services AND Google Services Framework, tick the checkbox for SystemUpdateService (REQUIRES ROOT)

3. In Settings>Wi-Fi use the menu button (hard key or 3 dots) to access the Advanced options. Then UNCHECK the option which reads Scanning Always Available

4. Freeze (REQUIRES ROOT) or Disable the apps called Google and Google Search with the obvious consequence that you won't be able to use Google Search (which I never use...I simply fire up my browser if I ever need to search)

the ideas are not my own. I simply used a combination of solutions that I found after days of scouring the internet and XDA. I three apps to see how the battery was performing in terms of app utilization and wakelocks:

1. Better Battery Stats (it's a paid app but well worth the price) as it shows the source of wakeslocks and other great info

2. CPU Spy (tells how long the phone is in various states of CPU mode including sleep)

3. GSAM Battery Monitor (which offers much deeper insight into app use of the battery than the Settings>Battery tool)

Hope this helps someone.
[Nexus 4 Q&A, Help & Troubleshooting] aeoveu:
I also read (in another thread...link forgotten) that disabling location history and location reporting in Google Now's settings helps fix the drain.

I turned off location reporting but left history on. Let's see.

sent from my mini tractor
[Nexus 4 Q&A, Help & Troubleshooting] Galaxo60:
Updated OP with findings and updates!.

:cool:
[Nexus 4 Q&A, Help & Troubleshooting] Galaxo60:
I myself did the test 2 weeks ago with those options disabled and enabled, and there wasn´t any difference. Major drain came from the "WiFi Location" option.

Right now I will make that battery comes to 10%-20%, and then enable those options to see if battery drain is gone or those options have also an important impact over battery life, because it seems that latest update on Google Services Framework has fixed the drain, at least the one coming from the "WiFi Location" option.

Read OP for the updates!.

;)
[Nexus 4 Q&A, Help & Troubleshooting] stuart0001:
Probably worth adding the direct link I posted as it doesn't show in updates.
[Nexus 4 Q&A, Help & Troubleshooting] Galaxo60:
Done!.

;)
[Nexus 4 Q&A, Help & Troubleshooting] eternityends:
Even with the updated Google Framework and Play store, I am noticing a steady drain in my battery even when it is off.

Anyone else have any ideas?
[Nexus 4 Q&A, Help & Troubleshooting] Galaxo60:
Try to make a screenshot and post it here, because with Android 4.3, some processes have been behaving differently from Android 4.2.2 and for Android 4.3.

Another famous wakelock around there is the Android System wakelock, that is different from this one, so every of these things should be resolved in different way.

:cyclops:
[Nexus 4 Q&A, Help & Troubleshooting] aeoveu:
Thanks for the info. There was something I've been seeing since yesterday - one of my apps (which never, ever did it before) is keeping a location wakelock - it didn't show up in Better Battery Stats, but shows in the Battery settings menu within Android (the wakelock is equal to the time the phone's been off the charger - and that's odd... this is regardless of the wifi location access option... and I have GPS disabled... so perhaps this, in combination with another app, is causing the wakelocks).

So I disabled location access for the app using App Ops (does it even work?). Let's see. The app in question is Amber Expense Manager (it's strange how it never gave a problem before...)

Right now, I've got wifi location enabled (from within the Wifi settings) but disabled Location Reporting from within Google Now. The location reporting has definitely reduced the number of wakeups and wakelocks I was facing before, but I'm trying to determine if the wifi location thingi has a significant impact.

And before, Google Now used to update itself with the locations. Now, it doesn't. No biggie, since I can force-refresh it (something i've been doing anyway).

---------- Post added at 08:46 AM ---------- Previous post was at 08:40 AM ----------

Okay - I don't think App Ops works.

Amber Money still retains a wakelock (what I did was fully charge the phone again to 100%, then unplug it) on GPS, equal to the same amount of time that the phone's been on battery.

In less than an hour, it went down by 2%.

I just turned off the wifi location as well, and let's hope it fixes some things. Otherwise, I'll just have to uninstall the application (boohoo!). Google now's location reporting is still off (location history is on though... not sure that's of any help, but it doesn't drain the battery, so I've left it on).
[Nexus 4 Q&A, Help & Troubleshooting] Galaxo60:
I searched for the app, because I couldn´t believe that such an app could cause a gps wakelock. But indeed, it uses GPS and Location settings, I don´t know why.

I saw also that app is not yet updated, and Android 4.3 brought many changes under the hood and introduced different ways to manage things. I think Location is one of them.

Try to uninstall app first to see if this could be the core of the problem. If it is, you should talk with developer and ask gently for an update if possible.

:highfive:
[Nexus 4 Q&A, Help & Troubleshooting] eternityends:
I've attached a few images of my battery life. On average, I used to get a full days worth of battery life. Now at 4 hours of barely being on my phone, it is already half dead.
[Nexus 4 Q&A, Help & Troubleshooting] Galaxo60:
It looks like a normal drain about those images, but having so poor life it is not normal.

Maybe those are hardware issues, because it seems that you don´t have any wakelock at all. Maybe try to change rom/kernel and see if the results are different.

:rolleyes:
[Nexus 4 Q&A, Help & Troubleshooting] eternityends:
I guess I could try a factory reset? It seemed like everything was fine until the latest Google Play Store update with the Android Device Manager came out. I've also noticed the USB connection from my phone to my Windows 7 PC is showing a driver error when I connect. I have no idea what's going on.
[Nexus 4 Q&A, Help & Troubleshooting] Galaxo60:
OP updated with latest tests.

:victory:
[Nexus 4 Q&A, Help & Troubleshooting] Galaxo60:
Factory reset is always a good idea with such a weird behavior as your phone has.

Also there are some differences between Google Android 4.3(JW) and AOSP Android 4.3(JS). You should try some AOSP build, because they have more fixes and patches that the Google counterpart.

In my case, I made a total wipe of phone to install stock 4.2.2. Then update came from Google for Android 4.3(JW) who also installs new radio and bootloader. The final step was to install custom recovery, and then an AOSP ROM and I´m fine now besides this Google Services drain.

:highfive:
[Nexus 4 Q&A, Help & Troubleshooting] eternityends:
After a factory reset I noticed it was draining even worse. Along with all my PC's not recognizing the device any more and trying multiple USB cables I've decided there is something physically wrong with this device and have started the RMA process. I guess I can't complain I've got one of the first hardware revisions of the N4 and haven't had other issues besides now.

Hopefully my new N4 will come soon and will work well :)
[Nexus 4 Q&A, Help & Troubleshooting] Galaxo60:
Glad I could help, I hope everything goes well with your device. If not, always is a good time to buy a new one.

:D
[Nexus 4 Q&A, Help & Troubleshooting] aeoveu:
Okay, another update.

I backed up the app using Titanium Backup, uninstalled it, then restored the backup from TiBa. So far, no location wake lock.

I think it could have been a glitch that it used the GPS constantly...but now, I no longer have the problem.

In fact, my nlcwakelock hasn't been more than 3 minutes in the past 7 hours, which is a HUGE improvement.

Next step: enabling WiFi location access to see if that has a significant impact on the wake lock.

sent from my mini tractor

---------- Post added at 08:54 PM ---------- Previous post was at 08:48 PM ----------

Try disabling Location Reporting from Google Now and see if that improves. Also, to kick things off, disable WiFi location scanning (from the WiFi settings menu...that'll help you get a clean slate, and then you can work your way from up there).

sent from my mini tractor
[Nexus 4 Q&A, Help & Troubleshooting] Raijin:
Galaxo60, thanks for the test you're doing. I would like to make them too, but I need to use my phone a lot of time through day. So thank you.
[Nexus 4 Q&A, Help & Troubleshooting] Galaxo60:
There is no need to do that, I already made all the tests myself and all the updates and findings are in the OP. I´m just saving you tons of hours of tests. On the other hand, if you want to make it for yourself, is also good. Maybe my results would differs from yours, so is a good thing also.

:silly:

No problem, I make the tests also through the day, because is my only device and I need it to be really good, both in performance and battery life. That´s why I´m doing this and started this post, trying to get the perfect tunning for my device, and at the same time, share with all of you, so you won´t have to invest tons of hours in this tests.

I think this harm no one, and many people could benefit from threads like this.

:victory:
[Nexus 4 Q&A, Help & Troubleshooting] TRSHD:
WOAH! I'm running stock 4.3 + FrancoKernel and I NEVER get that much screen time and and battery life! I'm thinking of selling my Nexus 4 now...
[Nexus 4 Q&A, Help & Troubleshooting] UncleMike:
I've been having this same problem with battery drain lately, but didn't want to disable Wi-Fi & mobile network location, but I did make another change recently that I have since reversed and it seems to have made a big difference so far: Settings > Wi-Fi > Advanced > Scanning always available. This was off by default, but I had turned it on to test how it affected Tasker, and left it on. Since turning it off again, Android OS is now at 6% battery used, as opposed to the 30%+ it was at yesterday. And, Wakelock Detector shows almost 3 hours of deep sleep in the last 4 hours, compared to yesterday's deep sleep of ZERO.

I hope this helps someone else.
[Nexus 4 Q&A, Help & Troubleshooting] aeoveu:
Well... My findings seem to corroborate yours - except disabling the location settings option (mobile networks and WiFi from the options) disables Google Now from my end, so I'm trying other workarounds :)

OK. So the drain was 1.5% per hour on WiFi only. When I went to data and enabled WiFi location detection, the drain rose to 1.7% after 2 hours (approx). When I DISABLED WiFi location detection, after an hour or so, the drain went down to 1.6% per hour.

Result? When using maps, WiFi location will save you battery and offer a much better accuracy level (generally speaking). If its enabled in the background, you're not gaining anything - rather, there's a small drain on the battery. I've decided to enable the option when I have Google maps turned on - and not use GPS if I have WiFi routers nearby, and disable it when I've quit Maps.

So... Feel free to put this in the OP as an alternative to disabling the Location Access settings. :)

sent from my mini tractor

---------- Post added at 06:28 PM ---------- Previous post was at 06:16 PM ----------

Okay. So, for anyone who might find that their circumstances are different, its very much possible.

Here's what I did to resolve my battery drain:

- updated the Play Services to the latest one (by downloading the newer Play Store manually).

- saw that an app was constantly engaging GPS (which was turned off, so I can assume it was using triangulation ALL the time) and reinstalled it (I couldn't live without it) (programs causing this drain may vary from phone to phone...mine was an expense management app).

- enabling WiFi location through the WiFi settings introduced a little bit of drain - but not much (only in small percentage points). I realized leaving it on in the background won't help you since triangulation uses less battery and achieves a similar output - if you're going to use Maps, you can then it on for better accuracy without the drain caused by GPS.

- restarted my phone once in between.

I use Google Now and couldn't get Now to work with Location Services disabled (my phone didn't budge - or I was doing something wrong). But for me, idle battery drain on WiFi was around 1.5% (I hadn't let the phone settle down, so I assume the actual drain would have been much less, cause I HAVE seen the drain as low as 0.8% per hour in this configuration...it was in this instance only when I brought it down to 1.5% from 3-4%.

sent from my mini tractor
[Nexus 4 Q&A, Help & Troubleshooting] Galaxo60:
I also never had good battery life until I changed to 4.3, so I guess this is the way it should always be.

This kind of behavior is usually fixed in many custom ROM's/Kernels, but also having the WiFi always scanning to connect a network will drain a lot of battery. I always have the WiFi off if I'm not going to use it. Also the scan interval can be changed to keep battery life.

As I said before, I'm doing now the final tests, but I recommend to always keep the WiFi location option disabled until you are going to use it. I already posted my stats with this tip and it really worth it.

As for the tests, below I share my stats at first cycle. I have been flashing a lot of ROM's lately and making tests, so I perform a full wipe and then made everything from the ground. This is the first full charge and discharge, I know battery will become better later.

As for Google Services, they got at first like 20% of total battery drain, but then it transformed into tiny drain, around 8% total battery life with all the Location options enabled. Most of the time I wasn't on WiFi, only 3G, so maybe that also made my battery drain a little faster than other days.

I think that this is the normal drain with android 4.3, because it is below the system itself, so I guess is kind of fixed for now.

I will post more images in few more battery cycles.

:cool:
[Nexus 4 Q&A, Help & Troubleshooting] Galaxo60:
OP updated!.

:cyclops:
[Nexus 4 Q&A, Help & Troubleshooting] UncleMike:
For years I've allowed Tasker to turn on Wifi every 10 minutes to see what's out there, and only leave it on if there's something I can connect to. About 2 months ago I decided to see what the battery impact would be from leaving Wifi on all the time. There was no noticeable change in battery life, which contradicts what you're saying. With Android 4.3 came the Scanning always available option, which allows apps to scan for nearby networks without actually turning Wifi on or connecting if a known network is nearby. Since this was a new option in 4.3 I decided to enable it and test it with Tasker, and it worked as expected, allowing Tasker to see nearby networks without Wifi ever being turned on (even by Tasker). Disabling this option in Android returned my Android OS battery usage to normal.
[Nexus 4 Q&A, Help & Troubleshooting] Indianrambo:
Thanks for the test.
[Nexus 4 Q&A, Help & Troubleshooting] Galaxo60:
I didn't know it was a new option, as far as I remember, that option was always there and moreover, I always had it activated because I don't like to use 3G when WiFi is available.

:rolleyes:

= = = = = = =

Edit: I found the option you were saying and yes, this is new from 4.3, I was confused about this one and the option above. For all my tests, I had it enabled since the beginning, so I don't know if this can cause an impact on battery, but I'm almost sure that this is not related to the Google Services drain, but maybe with some Android System wakelock or something like this.
[Nexus 4 Q&A, Help & Troubleshooting] Indianrambo:
Which version of Google play services to install I'm having 3.2.5
[Nexus 4 Q&A, Help & Troubleshooting] Galaxo60:
I have 3.2.25 installed, I don't know if it is a 3.2.5 version.

:p
[Nexus 4 Q&A, Help & Troubleshooting] Indianrambo:
Sorry typo it's 3.2.25
[Nexus 4 Q&A, Help & Troubleshooting] Galaxo60:
I do this for the benefit of all, hope it helped.

:D
[Nexus 4 Q&A, Help & Troubleshooting] Galaxo60:
OP updated!.

Added also some possibly solutions to the Android System battery drain.

:cool:
[Nexus 4 Q&A, Help & Troubleshooting] Indianrambo:
I unchecked WiFi & mobile network and location report. Is there anything turn on or off
[Nexus 4 Q&A, Help & Troubleshooting] Galaxo60:
With these disabled, you will be fine.

:good:
[Nexus 4 Q&A, Help & Troubleshooting] Waldos:
Thanks [MENTION=4658859]Galaxo60[/MENTION] for the great research!
[Nexus 4 Q&A, Help & Troubleshooting] Galaxo60:
I´m here to help.

:victory:
[Nexus 4 Q&A, Help & Troubleshooting] hooligan_016:
So do we have any idea what exactly is causing this? I've always been one to keep location services, etc. on, but only recently has it become an issue for me. I've been reading over this thread and scouring over BBS and Wakelock Detector trying to determine what is causing both the Google Play Services and Android OS services from letting my device go into deep sleep mode.

I did not experience this level of battery drain on 4.3 until the new release of Google Play Services (v 3.2.25 (761454-36)) and release of the Android Device Manager service.

Tonight I am going to reboot it before putting it on the charger, and then go a full day at work (on WiFi) so I can have a full day log to review keep awake time, wakelocks, etc. and see if anything can be gleaned from it. I know OP did several tests, which I appreciate, but I want to determine why it won't go to sleep even when I am just sitting in the same place for 8 hours (not moving) on wifi. It shouldn't be pinging my device that much haha.
[Nexus 4 Q&A, Help & Troubleshooting] montrealguy:
Can someone (preferably the OP) PLEASE clarify what is the latest version of the Google apps and explain how to upgrade them? There are a lot of newbies here who are experiencing this battery drain.

Google Play Services 3.2.25

Google Play Store 4.2.3

Google Search 2.6.7.721924.arm

Google Services Framework 4.3-737497

Am I missing any of them?

---------- Post added at 04:39 PM ---------- Previous post was at 04:20 PM ----------

OP- are you on JW or JS? I'm on stock JW. I've been curious about JS since it has more updates, but when I posted a thread about it, I was advised to stick to JW because JS has deadlocks.
[Nexus 4 Q&A, Help & Troubleshooting] aaatoel:
Amazing job with all these tests. In my system, the battery drain of Google services is approximately 5-6% during a full cycle, so I guess that this is a pretty standard result.
[Nexus 4 Q&A, Help & Troubleshooting] Galaxo60:
I know it is crazy, but also last month was full of change in terms of Google Play Services. I remember that there were like 2-3 updates of the app in just a week, so maybe people in Google was already detected this and tried to solve it.

About staying in one place, I think it won´t matter, I think that device still ping the servers to report location, not the other way around. The best would be that it only pings Google servers when phone determines that you move out of the place you were, but I think is the other way around.

Also there are some wakelocks about radio, so I don´t know exactly which would be the most suitable. Maybe an hybrid 48/84 would be the best for most of us, but for example, I have 84 and I don´t have any problem. People reported change from 84 to 48 and they good, so I think the best is to make tests and discover which is bette for you(not all carriers/signals work the same way).

Another thing I noticed is that Google Services consumed around 15%-20% of battery in the first 2-3 hours, and then, as time goes on, the drain is reduced until it reaches around 7%-8% which is the "normal" value now. I say "normal", because before of android 4.3, this drain didn´t even exist. Also noticed that first battery cycles(when making a clean flash of any ROM) consume more about Google Services.

:confused:

I have the same as you, except for the store. I have 4.2.9, but there is a new version, I think 4.3.1 or something like that. I always recommend [MENTION=2915683]BaNkS[/MENTION] GAPPS, who are really cool and quite debloated, just perfect if you don´t want a lof of unnecessary apps that you can download later from Play Store.

About the build, I´m on JS just because it is still in development and it has latest patches and commits, so for example, GPU works better IMO and it has the WiFi notifications issues resolved. About deadlocks, they are not so bad, just screen freezes like 5 sec and then everything is normal. I have had around 2-3 of this deadlocks since Android 4.3. came out, so although it is kind of annoying, I´m not worried about them.

:laugh:

Same as me, I think this would be the new standard for this background process, and we shouldn´t be worried about this until it reaches more than 10% total battery life.

:cool:
[Nexus 4 Q&A, Help & Troubleshooting] lecomiquelin:
I found a new solution!!!!!!!!!!!!!!!!!!

HEY GUYS, I FOUND A NEW SOLUTION!!!!!!!!!!!!!!!!!!

After I've tested all, and nothing works, i tried one thing, that at least seems to work.

***sorry for bad english first, i'm brazilian***

What i did:

- Went to settings, more tab

- Aplications, all tab

- I Searched for Google Services Framework (here is: Estrutura de Serviçoes do Google)

- I opened and clicked in Disable (deactivate... i dont know how its right, here is Desativar)

- So, go drink a coffe (I mean wait about 2 minutes), and then reactive (reenable) the app.

- And that's iiiiiiiiiiiiiiiiiit!!!! All will keep working normal and no need to disable any one feature, but, i think its not so simple. After I rebooted my Galaxy S4 (yes, its not a nexus 4, but I guess it works for all) the google services back to the list, but now using about 3~5%...

I hope it can help a lot of users... I was very sad with that bug, now it seems to be part solved.
[Nexus 4 Q&A, Help & Troubleshooting] Galaxo60:
Thanks for your comment, some people say that also clearing the data and the account from Google has worked for some of them, thing you did in certain way. You should check also for some days, because it can be tricky these kind of fixes. That´s why I didn´t include this particular method.

Some people reported that this worked at the beginning, but then after some hours/days, the drain became greater. If everything goes well for some days, come back and report and I can add your post to the OP as a new solution to this problem.

Anyway, thanks for share, and it doesn´t matter if you have a different device, I think this wakelocks can affect every single android phone out there.

:highfive:
[Nexus 4 Q&A, Help & Troubleshooting] Galaxo60:
Tonight I will update final results for tests, so be aware.

:highfive:
[Nexus 4 Q&A, Help & Troubleshooting] Galaxo60:
OP updated with final results. Screenshots attached.

If anyone needs something else, just write here, I will try to respond quickly.

:cowboy: