[Major Bug] Wifi Always Scan breaks Location Services - Nexus 5 General

Hello everyone.
I just wanted to get your attention on a major Android OS (Kitkat) bug in the interaction between Wifi -> Advanced -> Wifi Always Scan and the Location Service. Clearly the bug doesn't happen every time, but sometimes it does, and obviously I'm talking about stock rom / kernel / no root / locked bootloader.
Althought I can't prove it, this might also be the cause of the current GPS / Navigation issues, currently being reported here.
What makes me link this to that issue? Because when Wifi Always Scan bugs out, it prevents my phone to acquire a location even from the 3g network.
That would explain why in that thread many people report that they could navigate with Device Only, which doesn't use 3g or wifi for location, but they had major issues with High Accuracy, which uses all three sources.
Please take a minute to star the issue so that Google will hopefully fix it faster.
https://code.google.com/p/android/issues/detail?id=64597
Thank you,
TD

Just turn it off, all it does is waste battery anyway
Sent from my Nexus 5 using Tapatalk

Ben36 said:
Just turn it off, all it does is waste battery anyway
Sent from my Nexus 5 using Tapatalk
Click to expand...
Click to collapse
Thanks for your useful contribution.
It doesn't waste battery, it saves it. It enables to use the wifi location using a lower power state of the wifi chip compared to actually turned on wifi (which is also more accurate by miles than 3g location, works indoors in clubs where there is no 3g or gps signal, and not as battery expensive as gps location).
Also, people use that option for many things, I for one use it in MANY Tasker tasks flawlessly, whether the alternative (wifi periodic toggle and polling) would rape my battery.

Wifi automatically Turned off. Built in feature?
I kept my wifi on, and the had not used it basically just left the device in the room and had run off.
When I retured, the wifi was on in the power control widget but the wifi signal indicator icon in the notifications bar was absent.
is this normal/intended?
My wifi / internet connection is weak but continuous and my device is about ten to twelve feet away from the modem / router.
Can anybody help?

Although I have not a Nexus 5, my problem seems to be the same. I'll tell you if perhaps serve as any indication.
In my HTC EVO 3D, I've been running since the summer with CM10.2 (Android v4.3.1) with location mode set to "Network & WiFi" and "WiFi Always Scan ON". During this time the location was very accurate, location history left a fairly detailed trace. In Google Maps, was located immediately, as in Google+. If activated the GPS, even better. Summarizing, 0 issues with the location.
On January 1, I decided to upgrade to CM11 (Android v4.4.2), I set my location mode to "Battery Saving" & "Wifi Scan Always ON". During the first 10 days everything was perfect, the location history trail was so detailed as CM10.2 and battery consumption a little better. Google Maps and Google+ also positioned themselves almost immediately. Suddenly, on January 11 the location seems to stop of using WiFi networks and began guided only by the Network Cells (being rather more vague). Also when for some reason failed to position (being out of range of Network Cell), the phone started to not enter Deep Sleep Mode and the battery started to discharge at high speed. Google Maps, Google+, 1Weather ... were unable to obtain the current location or showed the last known location of hours before. Rebooting the phone sometimes temporarily solved the problem, but sometimes not.
I tried to change the placement options; abroad, with "high accuracy" mode, the location worked well, but indoors the GPS was not able to find satellites (logical) and still the same problems. I enabled and I disabled the location, nothing. Factory reset, no change.
To rule out a hardware failure, I returned CM10.2. Everything about the location worked smoothly... Return to CM11, again the same problems.
In short, my impression is that this is a software bug, as in versions prior to v4.4 Android location "Network & WiFi" + "Scan Always ON WiFi" works correctly. Moreover, not only occurs in the Nexus 5.
I have marked with a star your ticket.
I'll keept testing.

I get this problem when I use tether with WiFi always scan enabled.
When I disabled tethering, I have to manually enable WiFi to fix the location reporting issue.
With WiFi scanning not enabled, I do not get this problem
Sent from my Nexus 5 using XDA Premium 4 mobile app

I think I have similar problem and I really hope smbody can help me.
On my stock nexus 5(4.4.2) wifi location don't work in google maps and ingress, when I turn it on instead of gps location.
But in other apps wifi location works( yandex.maps, 4square)
Only reboot helps

Hello again.
I just updated Google Maps to version 7.6.0 and Google Play Services to version 4.2.39 and all the problems I had with the location are gone, everything is okay again, as it did in CM10.2. So it looks like it is confirmed that it was a software bug.

Sorry, I know this post is quite stale, but I came across it doing a search about this very same problem I've seen on my LG G4 (stock). I have a Tasker task that uses WiFi near state and I use the "Allow Wifi scanning..." option in my Advanced WiFi settings. Whenever I would use WiFi tethering and then later turn it off, I noticed my Tasker task would not detect the WiFi networks it was supposed to. If I turn the "Allow scanning" option of and back on, or just turn on WiFi altogether, it starts working again.
So, after more than a year and a half, and on a newer version of Android and it still doesn't work right. Who knows; maybe it's a Tasker problem.
-SR-

Related

[Q] could wifi be the problem with samsung captivate's gps issues

anyone else notice that when using the Samsung captivate & navigation that is recommends turning on WiFi. it doesn't make sense, but i notice it makes a huge difference in speeding up satellite connection time with WiFi on.
could this be the issue with the GPS??
please confirm this.
-Alex
This is not a fix. Turning WFi on will help give your phone another source to determine your location. The key thing here is that WiFi cannot determine your location as accurately as GPS can. If you look again, you'll probably see that your phone will "lock" onto your position much faster, but it's probably not going to be accurate enough to be usable.
norcal einstein said:
This is not a fix. Turning WFi on will help give your phone another source to determine your location. The key thing here is that WiFi cannot determine your location as accurately as GPS can. If you look again, you'll probably see that your phone will "lock" onto your position much faster, but it's probably not going to be accurate enough to be usable.
Click to expand...
Click to collapse
you must have read the title before i edited it.
im not using the WiFi as a location source since i don't have any WiFi internet on the road.
but i notice that the GPS locks on quicker than without the Wifi on.
my nexus one never suggest to turn on WiFi when using navigation
Its not necessarily wifi based location but it can use wifi to download gps data. For a date lock. Its just a suggestion, I don't see why out would make a difference with out a wifi signal.
I prefer to not have network location or sensor aiding enabled. Sensor aiding really doesn't work. Made my my tracks results erratic. Network location gets me within 2 miles, not exactly good for navigation, having it on only allow something to fall back on of you lose gps signal but the whole process of the phone switching from one source to the other and back again takes to long. Keeping network location off forces it to only try to get a gps lock and in my opinion works better.
As far as wifi, if you believe it works better that way then do what every you think helps. It really should only download the data and once it has it it is done with wifi un till it needs new data which usually won't be for several hours.
Sent from my SAMSUNG-SGH-I897

GPS still terrible on 2.3.4 sprint tab

First of all, yes I searched the forum, and google, and tho I might have missed something, I think I've tried most of the reccommendations out there (short of a custom rom because those are in short demand for the sprint tab.)
I did a wipe / odin to 24, updated to 28, then 2.3.4. Gps still sucked, so I flashed rooted 2.3.4 and tried 3 or 4 gps "fix" apps for this thing, none of which have made any difference. I can get gps but it takes FOREVER, usually around 5 minutes. Often it will find 6 or more satellites too, but just sit there and not lock on or whatever to any, then randomly it works. I've tried every combo of toggling gps, soft reset, and hard reset.
In texas I had the same problem on froyo, now I'm in Costa Rica... I'm assuming since gps stands for GLOBAL positioning sys that where I am shouldn't affect it. But its just SO darn slow ilby the time it starts working its useless.
and I test it outside on sunny days with open sky, so I know that's not the culprit. Nor ia it in a case when I try
Any thoughts or ideas at all would be MUCH appriciated as I really need to start using my tab for mapping.
Thanks!!!
Sent from my SPH-P100 using XDA App
I think you're doing it wrong son. Try these settings. In wireless and network, mobile networks, uncheck 3g data. In location and security, check both use wireless networks and use GPS satellites. I assume you are using wireless tether from phone to give tab internet. Turn wifi on obviously. You do have the modded wpa_supplicant file for ad hoc for the tab right? I tried timing myself after doing all those settings I said and how long with GPS tools app and Google maps to get a lock and it was immediate. This is coming from never have using the GPS since the complete back to stock with ea24 all the way up to rooted gb.
People are saying to put the tab into airplane mode. If you want to use the GPS or things like weather bug or radar now, you at least need to have location from network enabled for it to assist in finding your location. You're not pulling data from the tower, the tower is helping the apply to locate where you're at, along with the GPS. GPS alone and wifi didn't work for me. When I enabled the settings I told you about, the GPS apps immediately came to life and worked great.
oscarthegrouch said:
I think you're doing it wrong son. Try these settings. In wireless and network, mobile networks, uncheck 3g data. In location and security, check both use wireless networks and use GPS satellites. I assume you are using wireless tether from phone to give tab internet. Turn wifi on obviously. You do have the modded wpa_supplicant file for ad hoc for the tab right? I tried timing myself after doing all those settings I said and how long with GPS tools app and Google maps to get a lock and it was immediate. This is coming from never have using the GPS since the complete back to stock with ea24 all the way up to rooted gb.
People are saying to put the tab into airplane mode. If you want to use the GPS or things like weather bug or radar now, you at least need to have location from network enabled for it to assist in finding your location. You're not pulling data from the tower, the tower is helping the apply to locate where you're at, along with the GPS. GPS alone and wifi didn't work for me. When I enabled the settings I told you about, the GPS apps immediately came to life and worked great.
Click to expand...
Click to collapse
I'm in costa rica with a cdma sprint tab, so 3g is always disabled, and because there is no service I disabled network location because I figured it couldn't get that data with no signal, and my location kept going to some random location around the world. And when I need gps I'm out far away from wifi hotspots too, so not worried about that setting I don't think.
Wifi hotspots only, no tethering, and I don't have the wpa supplicant file, but again no tethering so I'm assuming that is not nessicary.
And in Airplane mode it never gets a lock. At least on froyo it never would. I would turn airplane on then activate gps and it never ever found a satellite. I researched it and I thought in airplane the gps couldn't function until airplane mode was disabled again, even if gps toggled...
I appriciate your input, but I don't think its going to work given my circumstances.
Thanks!
Sent from my SPH-P100 using XDA App

ASUS routers (ac86u/ac87u/etc) - battery drain fix

I mainly work at home, so pretty much on wifi all of the day except for the odd hour or so to do school runs. I noticed that with WIFI on, i'm getting terrible battery life - less than 24hrs. This is with most things disabled (location history, google now, etc) but wifi and mobile data on all the time and GPS enabled. Of course mobile data doesn't kick in until i leave my wifi zone. Unfortunately even with location services off, Samsung doesn't have a option to disable the always scanning totally. This means ONLY when you are out of wifi connectivity will the always scanning option turn off (assuming you have the "allow always scanning" in the wifi settings turned off). Lo and behold with this setting (always allow scanning - when wifi on only) and spending more time on mobile data i notice my battery life is infinitely better. I went from the usual 30° battery drain slope to a flat line barely draining battery. So with no other change in apps/settings/etc, and just turning my wifi off, so LTE kicked in and phone in same location in the house i practically doubled battery life.
So then i started looking and reading. Finally it is clear it is my router/wifi draining the bloody battery so i started delving deeper. Now i have an asus ac68u with stock firmware. I changed the DTIM as follows under Wireless->Professional tab - (i can't post links or images so use the below in your browser)
193.104.35.163/asus.png
Now i'm back to a flat line drain on wifi.
May work for others.
(sigh)...my router doesn't let me configure those settings (ea9200). Still getting the drain
There could be multiple reasons for battery drain so this is not the holy grail for battery drain issues.
However the router issues is easy to identify. If you're getting battery drain for no reason at home/work where you are on wifi coverage, just switch wifi off and go onto your mobile plan (assuming you have reasonable 3g/4g/lte service) and look at your battery graph before and after. If you go from a ski slope to a flat line, then you have wireless problems. Otherwise look elsewhere. Remember your 'always allow scanning' setting should be set for 'wifi only' for this test.
This fix worked wonders for me. I immediately noticed 10x better battery life on par with having wifi disabled.
iforgotmyusername said:
193.104.35.163/asus.png
Now i'm back to a flat line drain on wifi.
May work for others.
Click to expand...
Click to collapse
hi..could you perhaps upload the pic to dropbox and share the link here? you could use a url shortener as well
qpalcb said:
hi..could you perhaps upload the pic to dropbox and share the link here? you could use a url shortener as well
Click to expand...
Click to collapse
I don't have a dropbox account, and i can' t post links yet so neither of that would work. Just put h t t p in front of that and it will work fine (and it's not a click bait, popup adverts, etc)
iforgotmyusername said:
I mainly work at home, so pretty much on wifi all of the day except for the odd hour or so to do school runs. I noticed that with WIFI on, i'm getting terrible battery life - less than 24hrs. This is with most things disabled (location history, google now, etc) but wifi and mobile data on all the time and GPS enabled. Of course mobile data doesn't kick in until i leave my wifi zone. Unfortunately even with location services off, Samsung doesn't have a option to disable the always scanning totally. This means ONLY when you are out of wifi connectivity will the always scanning option turn off (assuming you have the "allow always scanning" in the wifi settings turned off). Lo and behold with this setting (always allow scanning - when wifi on only) and spending more time on mobile data i notice my battery life is infinitely better. I went from the usual 30° battery drain slope to a flat line barely draining battery. So with no other change in apps/settings/etc, and just turning my wifi off, so LTE kicked in and phone in same location in the house i practically doubled battery life.
So then i started looking and reading. Finally it is clear it is my router/wifi draining the bloody battery so i started delving deeper. Now i have an asus ac68u with stock firmware. I changed the DTIM as follows under Wireless->Professional tab - (i can't post links or images so use the below in your browser)
193.104.35.163/asus.png
Now i'm back to a flat line drain on wifi.
May work for others.
Click to expand...
Click to collapse
I have the same router as you and I went to the professional tab. Then what do I do with the IP you posteD? I think this solution is the right one guys but I haven't figured it out yet
edit: Did not work
mrlooolz said:
I have the same router as you and I went to the professional tab. Then what do I do with the IP you posteD? I think this solution is the right one guys but I haven't figured it out yet
edit: Did not work
Click to expand...
Click to collapse
Paste the IP in your browser to show the screenshot he took with the settings he changed. Basically you need to set the DTIM Interval to 3 and the Beacon Interval to 300 for both the 2.4 GHz and 5 GHz bands.

A wifi conundrum (unsolved)

Hi everyone
I have a profile that that kicks in every 30 mins from 8 am to 9pm, to sync my account. I have set it up to use wifi first, but if there is no wifi connection it will go to my mobile data instead.
Now here is the problem if my phone is on standby it always connects via mobile data regardless of a wifi connection is available. But if I am using my device at the time when the task runs then it will connect to wifi. I have checked my, keep wif on in sleep option and it is set to always.
Could anyone explain as to what this is happening?
Thanks in advance
What is your Android version?
I am currently using a custom rom called exodus which is currently based on marshmallow.
Check if Tasker is excludied from Battery Optimization and whether Wi-Fi is not deactivated while the phone is in sleep mode in Settings/Wi-Fi/Advanced/Keep Wi-Fi on during sleep.
yep tasker is excluded from battery optimisation and the allow wifi during sleep policy is always.
If you're turning wifi on with tasker action wifi turn on, try instead of that shell script "svc wifi enable".
Ok thanks, I will let you know the out come of this. I was using secure settings to enable Wifi as the command built in tasker, is not compatible from kitkat and onwards if I remember correctly.
I found out "svc wifi enable" command does exactly the same thing
Discovered I'm having the very same problem on cm13 and the batch jobs have been done by initialized mobile data. Finally found out a solution to initialize wifi instead of mobile data. I've no limited data plan, but wifi is more battery friendly.
taisto said:
Discovered I'm having the very same problem on cm13 and the batch jobs have been done by initialized mobile data. Finally found out a solution to initialize wifi instead of mobile data. I've no limited data plan, but wifi is more battery friendly.
Click to expand...
Click to collapse
Care to share the solution?
After all this is a community that people use to, find solutions to problems and to get the most out of their device. Which also help others who experience the issue for future reference.
Does anyone else know a solution to this?
HatchetEgg said:
Does anyone else know a solution to this?
Click to expand...
Click to collapse
Do you actually wait for wifi to connect?
Does your phone do the low power screen off wifi thingy?
rignfool said:
Do you actually wait for wifi to connect?
Does your phone do the low power screen off wifi thingy?
Click to expand...
Click to collapse
Yes under normal circumstances it takes about 20 seconds to connect.
No because for some reason my wifi will only switch on if the screen is on.
I also have uninstaled my custom kernel, but this issue still appears from time to time.
There's a setting in wifi connection settings that you can set to that says "keep Wi-Fi on during sleep"
This same setting is often repeated in battery apps like powernap, naptime, better battery saver etc.
Even though the wording is the same, I don't believe they are all touching the same setting so go find those apps if you have them installed.
Also, disable all native battery savers (including Samsung 2 or 3 different ones,, doze, battery optimization etc etc just to see if your problem goes away.... Which it will. At least you'll know though
I have the same problem with Wi-Fi connection.
I have a profile to turn Wi-Fi on and try to connect when certain conditions meet and the screen is off in that case.
It seems that the phone has difficulties turning Wi-Fi on and connecting to it when screen is off. Tasker does manage to turn Wi-Fi on but the phone somehow does not connect *reliably* in all cases.
Tasker is excluded from battery optimization, Wi-Fi on during sleep. I tried turning cpu on for a short time hoping that it will connect, but still no result.
The only possible solution might be turning the screen on briefly at that moment.
If anybody has a better idea, you are more than welcome to share!
alienyd said:
I have the same problem with Wi-Fi connection.
I have a profile to turn Wi-Fi on and try to connect when certain conditions meet and the screen is off in that case.
It seems that the phone has difficulties turning Wi-Fi on and connecting to it when screen is off. Tasker does manage to turn Wi-Fi on but the phone somehow does not connect *reliably* in all cases.
Tasker is excluded from battery optimization, Wi-Fi on during sleep. I tried turning cpu on for a short time hoping that it will connect, but still no result.
The only possible solution might be turning the screen on briefly at that moment.
If anybody has a better idea, you are more than welcome to share!
Click to expand...
Click to collapse
I can certainly say that turning the screen on will enable wifi, as I have resulted to this as well. But unfortunately I do not know any other solutions to try.
loogielv said:
There's a setting in wifi connection settings that you can set to that says "keep Wi-Fi on during sleep"
This same setting is often repeated in battery apps like powernap, naptime, better battery saver etc.
Even though the wording is the same, I don't believe they are all touching the same setting so go find those apps if you have them installed.
Also, disable all native battery savers (including Samsung 2 or 3 different ones,, doze, battery optimization etc etc just to see if your problem goes away.... Which it will. At least you'll know though
Click to expand...
Click to collapse
My Wifi is set to always "keep wifi on during sleep"
I'm going to resort to flashing stock rom again and see if that helps. As I am only using doze and amplify to save battery, all settings for that has been adjusted to the guide I found.
HatchetEgg said:
My Wifi is set to always "keep wifi on during sleep"
I'm going to resort to flashing stock rom again and see if that helps. As I am only using doze and amplify to save battery, all settings for that has been adjusted to the guide I found.
Click to expand...
Click to collapse
Before reflash, just disable xposed and see what you get... I will bet half of this soft taco I'm eating your problem disappears with greenify and or amplify. I'm not saying don't use them at all... Just make sure it works without them. I used to have some serious battery apps, but found after disabling, my battery was IMMENSELY better. And I had no config to deal with. But first things first... IT'S without a doubt, no question, a battery app setting or a system app that's being put to sleep that should be white listed

Location + Wifi mess

Why does Location turn on whenever I connect to a Wifi network? I never had this kind of behaviour before. How to stop this? I read online that disabling Locate my phone would do the trick, but it doesn't.
Also, since a few weeks, I always get the Location consent dialog, and even if I agree, it always asks me. I want to always agree and stop being asked every single time. Even Xposed modules don't do anything on my rooted S7E. Do you guys have any hint?
Yeah you can't turn them off now.
I figured the only way the data collection won't hurt me is if i don't have any accounts synced to my phone.
They tied down the Geo location for most radio connections the phone has.
Irritating. You can toggle by using the phone gps only but my experience, my map apps tend to not work unless I use the high setting.
Most phones has AGPS units where it's always assisted by other connections.
And individual gps units are exactly that: gps (garmins... Etc)
Good luck

Categories

Resources