Bug 598508 - Fix geolocation on Android, r=dougt a=blocking-fennec

This commit is contained in:
Michael Wu
2010-09-21 19:36:58 -07:00
parent 26835474b5
commit 76193490c3
3 changed files with 10 additions and 8 deletions

View File

@@ -322,7 +322,9 @@ class GeckoAppShell
if (provider == null)
return;
sendEventToGecko(new GeckoEvent(lm.getLastKnownLocation(provider)));
Location loc = lm.getLastKnownLocation(provider);
if (loc != null)
sendEventToGecko(new GeckoEvent(loc));
lm.requestLocationUpdates(provider, 100, (float).5, GeckoApp.surfaceView, Looper.getMainLooper());
} else {
lm.removeUpdates(GeckoApp.surfaceView);