Closed Bug 989720 Opened 10 years ago Closed 10 years ago

Geolocation not working and shows mock location

Categories

(Firefox Build System :: General, defect)

ARM
Gonk (Firefox OS)
defect
Not set
normal

Tracking

(blocking-b2g:1.3T+, b2g-v1.3T fixed, b2g-v1.4 fixed, b2g-v2.0 fixed)

RESOLVED FIXED
mozilla31
blocking-b2g 1.3T+
Tracking Status
b2g-v1.3T --- fixed
b2g-v1.4 --- fixed
b2g-v2.0 --- fixed

People

(Reporter: gerard-majax, Assigned: dougt)

References

Details

(Keywords: regression)

Attachments

(3 files)

On current gecko running on Desire Z and Nexus S, when using Geolocation, I'm always getting a mock location based in Paris.

Logcat shows:
I/Gecko   ( 1194): *** injecting location
I/Gecko   ( 1194): *** lat: 48.860000
I/Gecko   ( 1194): *** lon: 2.350000
I/Gecko   ( 1194): *** accuracy: 40000.000000
E/GeckoConsole( 1194): [JavaScript Error: "formatURL: Couldn't find value for key: MOZ_MOZILLA_API_KEY" {file: "jar:file:///system/b2g/omni.ja!/components/nsURLFormatter.js" line: 118}]

If WiFi is disabled, you can run into bug 989719.

STR:
 0. Open HERE Maps
 1. Allow location

Expected:
 Current location is found

Actual:
 Fake location is found
Probably a regression from bug 977448.

Leaving qawanted here to either confirm this on Buri 1.4 or Tarako 1.3T.
Blocks: 977448
Component: Geolocation → Build Config
Keywords: qawanted
Not a mock location -- this is a location provided by MLS.  Sometimes MLS is wrong.  You can help my stumbling your area.
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → INVALID
lets leave this open until I get more data from reporter. :)
Assignee: nobody → dougt
Status: RESOLVED → REOPENED
Resolution: INVALID → ---
So there is probably something else broken. But this is a first patch to fix the JS error reported. With this one, however, I still get a wrong location. Looking at the code, I see |#ifdef DEBUG_GPS| which is wrong, at least.
Attachment #8399142 - Flags: review?(dougt)
(In reply to Doug Turner (:dougt) from comment #3)
> lets leave this open until I get more data from reporter. :)

I tried the DEBUG_GPS = 5, but without any luck. Maybe it's because of my hackish device. I'll have to try on another.

Still, some things I don't get:
 - geo.provider.use_mls is defined at false in b2g/app/b2g.js, and I did not enabled it by hand
 - reverting bug 977725 does not help
 - there is clearly no low level gps request being sent at all on my Desire Z, but I see some on my Nexus S
 - on Nexus S, I see correct location but I still see Paris location being injected

I'll have to bisect.
Comment on attachment 8399142 [details] [diff] [review]
Fixing the JS error

Review of attachment 8399142 [details] [diff] [review]:
-----------------------------------------------------------------

Why is this a problem?  Safe-browsing and Geolocation on desktop work fine as this is.
agps is probably not configured correctly on either the Desire Z and Nexus.  Please send me your gps.conf and the log when debug is set to 5.
(In reply to Doug Turner (:dougt) from comment #6)
> Comment on attachment 8399142 [details] [diff] [review]
> Fixing the JS error
> 
> Review of attachment 8399142 [details] [diff] [review]:
> -----------------------------------------------------------------
> 
> Why is this a problem?  Safe-browsing and Geolocation on desktop work fine
> as this is.

This patch fixes the JS error reported in logcat:
E/GeckoConsole( 1194): [JavaScript Error: "formatURL: Couldn't find value for key: MOZ_MOZILLA_API_KEY" {file: "jar:file:///system/b2g/omni.ja!/components/nsURLFormatter.js" line: 118}]
(In reply to Doug Turner (:dougt) from comment #7)
> agps is probably not configured correctly on either the Desire Z and Nexus. 
> Please send me your gps.conf and the log when debug is set to 5.

You don't think there is an issue if both geolocations sources are reporting values that different ?

After more investigation, I suspect the Desire Z issue is not related. But on Nexus S, what I'm observing is that as I said, I'm getting a fix very close to my real from one source with good accuracy value, and then a couple of seconds after, I'm getting a fix located 250km away with an accuracy of 40km.
Flags: needinfo?(dougt)
(In reply to Doug Turner (:dougt) from comment #7)
> agps is probably not configured correctly on either the Desire Z and Nexus. 
> Please send me your gps.conf and the log when debug is set to 5.

Oh, and I don't know if there is anything wrong with A-GPS at all. On my Nexus S (let's focus on this one, it exposes calls to the gps_init() correctly), the sequence of events is:
 - gps is initialized, logcat shows .so's init messages
 - a first fix comes after one second, exposing call to InjectLocation, which seems to be the intended behavior
 - this first fix is located on Paris, accuracy of 40km
 - 5-10 secs after, a new fix arrives, located on my current location, with an accuracy of 50-100m
 - then sometimes, I get the Paris fix being re-injected (logcat exposes the debug message)
 - then a couple of seconds after, I get the correct fix again.

It does not seems like DEBUG_GPS has any impact on my device, but I can investigate by hacking NMEA and Satellites View callback in Gecko, if needed.
Blocked to test it on Buri device, no Geo-location is found when open Here Maps app bug 984812

1.4 Environmental Variables:
Device: Buri 1.4 MOZ
BuildID: 20140331000202
Gaia: 4c3b2f57f4229c5f36f0d8fd399e65f4db88f104
Gecko: 3aaca223b673
Version: 30.0a2
Firmware Version: v1.2-device.cfg
Keywords: qawanted
(In reply to sarsenyev from comment #11)
> Blocked to test it on Buri device, no Geo-location is found when open Here
> Maps app bug 984812

This isn't right. You need to have a SIM on your device & be outdoors to get geolocation to work.
Keywords: qawanted
Attached file log3312014.txt
On 1.5 Geolocation is founded correctly when Wi_Fi is on, see bug 989719 when WiFi is diabled

Also I followed steps in comment 9 (SIM card inserted and outdoor), but Geo-location doesn't work on 1.4 and 1.3,the error message notifies "Can't find your location"
Added a logcat

1.5 Environmental Variables:
Device: Buri 1.5 MOZ
BuildID: 20140331040200
Gaia: 26839cb46f856d610b192f5655a8c38a6bfe0829
Gecko: d8e8f13bd4ae
Version: 31.0a1
Firmware Version: v1.2-device.cfg
Keywords: qawanted
minus for 1.4
blocking-b2g: 1.4? → -
Comment on attachment 8399142 [details] [diff] [review]
Fixing the JS error

Review of attachment 8399142 [details] [diff] [review]:
-----------------------------------------------------------------

The bug is from here, not from nsURLFormatter.

https://mxr.mozilla.org/mozilla-central/source/b2g/app/b2g.js#192
192 pref("geo.wifi.uri", "https://location.services.mozilla.com/v1/geolocate?key=%MOZ_MOZILLA_API_KEY%");

nsURLFormatter is looking for MOZ_MOZILLA_API_KEY in nsURLFormatter._defaults. It should be MOZILLA_API_KEY instead. Also, this patch breaks safebrowsing which uses GOOGLE_API_KEY correctly.

Thanks,
Monica
Attachment #8399142 - Flags: review?(dougt) → review-
This bug was introduced in bug 977725. Doug, do you want to change all occurrences of MOZILLA_API_KEY to MOZ_MOZILLA_API_KEY?
Attachment #8400186 - Flags: review?(mmc)
Flags: needinfo?(dougt)
Attachment #8400186 - Flags: review?(mmc) → review+
https://hg.mozilla.org/integration/mozilla-inbound/rev/15f36e5e47ac

fabrice, this is just to make you aware of this change.
Flags: needinfo?(fabrice)
https://hg.mozilla.org/mozilla-central/rev/15f36e5e47ac
Status: REOPENED → RESOLVED
Closed: 10 years ago10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla31
(In reply to Doug Turner (:dougt) from comment #18)
> https://hg.mozilla.org/integration/mozilla-inbound/rev/15f36e5e47ac
> 
> fabrice, this is just to make you aware of this change.

ha, that needs to be backported to 1.3t.
blocking-b2g: - → 1.3T+
Flags: needinfo?(fabrice)
Product: Core → Firefox Build System
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: