Upstream version 10.39.225.0
[platform/framework/web/crosswalk.git] / src / content / public / android / java / src / org / chromium / content / browser / LocationProviderFactory.java
index b88ad59..5afec92 100644 (file)
@@ -12,9 +12,8 @@ import android.location.LocationManager;
 import android.os.Bundle;
 import android.util.Log;
 
-import com.google.common.annotations.VisibleForTesting;
-
 import org.chromium.base.ThreadUtils;
+import org.chromium.base.VisibleForTesting;
 
 import java.util.List;
 
@@ -97,7 +96,7 @@ public class LocationProviderFactory {
 
         @Override
         public void onLocationChanged(Location location) {
-            // Callbacks from the system location sevice are queued to this thread, so it's
+            // Callbacks from the system location service are queued to this thread, so it's
             // possible that we receive callbacks after unregistering. At this point, the
             // native object will no longer exist.
             if (mIsRunning) {
@@ -150,13 +149,9 @@ public class LocationProviderFactory {
             // bounce notifications to the Geolocation thread as they arrive in the mainLooper.
             try {
                 Criteria criteria = new Criteria();
+                if (isGpsEnabled) criteria.setAccuracy(Criteria.ACCURACY_FINE);
                 mLocationManager.requestLocationUpdates(0, 0, criteria, this,
                         ThreadUtils.getUiThreadLooper());
-                if (isGpsEnabled) {
-                    criteria.setAccuracy(Criteria.ACCURACY_FINE);
-                    mLocationManager.requestLocationUpdates(0, 0, criteria, this,
-                            ThreadUtils.getUiThreadLooper());
-                }
             } catch (SecurityException e) {
                 Log.e(TAG, "Caught security exception registering for location updates from " +
                     "system. This should only happen in DumpRenderTree.");