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 85658 254f355a4a9605a1879326ffdc2ac8e0215c35b8
parent 85657 9b2f2f9242531212b0071ff3377fb9c989ee51cd
child 85659 b36175bbda47da731573c8031a132a4f2385235d
push id805
push userakeybl@mozilla.com
push dateWed, 01 Feb 2012 18:17:35 +0000
treeherdermozilla-aurora@6fb3bf232436 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjdm
bugs712576
milestone12.0a1
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);
                         }