parent
6a3a7b41eb
commit
b61dff48d6
1 changed files with 1 additions and 5 deletions
|
@ -1,7 +1,6 @@
|
||||||
package net.osmand.plus;
|
package net.osmand.plus;
|
||||||
|
|
||||||
import android.location.Location;
|
import android.location.Location;
|
||||||
import android.os.HandlerThread;
|
|
||||||
import android.os.Looper;
|
import android.os.Looper;
|
||||||
|
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
|
@ -33,8 +32,6 @@ public class LocationServiceHelperImpl extends LocationServiceHelper {
|
||||||
|
|
||||||
private final OsmandApplication app;
|
private final OsmandApplication app;
|
||||||
|
|
||||||
private final HandlerThread mHandlerThread = new HandlerThread("LocationServiceHelperThread");
|
|
||||||
|
|
||||||
// FusedLocationProviderClient - Main class for receiving location updates.
|
// FusedLocationProviderClient - Main class for receiving location updates.
|
||||||
private final FusedLocationProviderClient fusedLocationProviderClient;
|
private final FusedLocationProviderClient fusedLocationProviderClient;
|
||||||
|
|
||||||
|
@ -49,7 +46,6 @@ public class LocationServiceHelperImpl extends LocationServiceHelper {
|
||||||
|
|
||||||
public LocationServiceHelperImpl(@NonNull OsmandApplication app) {
|
public LocationServiceHelperImpl(@NonNull OsmandApplication app) {
|
||||||
this.app = app;
|
this.app = app;
|
||||||
mHandlerThread.start();
|
|
||||||
|
|
||||||
fusedLocationProviderClient = LocationServices.getFusedLocationProviderClient(app);
|
fusedLocationProviderClient = LocationServices.getFusedLocationProviderClient(app);
|
||||||
|
|
||||||
|
@ -104,7 +100,7 @@ public class LocationServiceHelperImpl extends LocationServiceHelper {
|
||||||
// request location updates
|
// request location updates
|
||||||
try {
|
try {
|
||||||
fusedLocationProviderClient.requestLocationUpdates(
|
fusedLocationProviderClient.requestLocationUpdates(
|
||||||
fusedLocationRequest, fusedLocationCallback, mHandlerThread.getLooper());
|
fusedLocationRequest, fusedLocationCallback, Looper.myLooper());
|
||||||
} catch (SecurityException e) {
|
} catch (SecurityException e) {
|
||||||
LOG.debug("Location service permission not granted");
|
LOG.debug("Location service permission not granted");
|
||||||
throw e;
|
throw e;
|
||||||
|
|
Loading…
Reference in a new issue