Bug 712576 - On Android, we place a criteria on the location provider such that it must return a 'fine' grain location. It could be that this prevents some location providers -- ones that have network but not a GPS backed device -- from working. r=jdm
authorDoug Turner <dougt@dougt.org>
Fri, 13 Jan 2012 16:01:58 -0800
changeset 84433 254f355a4a9605a1879326ffdc2ac8e0215c35b8
parent 84432 9b2f2f9242531212b0071ff3377fb9c989ee51cd
child 84434 b36175bbda47da731573c8031a132a4f2385235d
push id21848
push usermak77@bonardo.net
push dateSat, 14 Jan 2012 09:02:20 +0000
treeherdermozilla-central@27a7f197c6fc [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjdm
bugs712576
milestone12.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 712576 - On Android, we place a criteria on the location provider such that it must return a 'fine' grain location. It could be that this prevents some location providers -- ones that have network but not a GPS backed device -- from working. r=jdm
mobile/android/base/GeckoAppShell.java
--- a/mobile/android/base/GeckoAppShell.java
+++ b/mobile/android/base/GeckoAppShell.java
@@ -568,19 +568,18 @@ public class GeckoAppShell
         getMainHandler().post(new Runnable() { 
                 public void run() {
                     LayerView v = GeckoApp.mAppContext.getLayerController().getView();
 
                     LocationManager lm = (LocationManager)
                         GeckoApp.mAppContext.getSystemService(Context.LOCATION_SERVICE);
 
                     if (enable) {
-                        Criteria crit = new Criteria();
-                        crit.setAccuracy(Criteria.ACCURACY_FINE);
-                        String provider = lm.getBestProvider(crit, true);
+                        Criteria criteria = new Criteria();
+                        String provider = lm.getBestProvider(criteria, true);
                         if (provider == null)
                             return;
 
                         Looper l = Looper.getMainLooper();
                         Location loc = lm.getLastKnownLocation(provider);
                         if (loc != null) {
                             GeckoApp.mAppContext.onLocationChanged(loc);
                         }