Commit a19de98a authored by divya.bansal's avatar divya.bansal Committed by Commit bot

Refactoring the code for location manager.

Code refactoring for location provider while registering for location updates.
While registering the location provider for location updates location updates are requested
redundantly for gps enabled or disabled code.

BUG=411182

Review URL: https://codereview.chromium.org/546633004

Cr-Commit-Position: refs/heads/master@{#293766}
parent 2a5b2789
......@@ -150,13 +150,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.");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment