mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge
synced 2024-08-25 08:40:43 +02:00
replace GPS_PROVIDER with NETWORK_PROVIDER to retrieve the gps data from the network
This commit is contained in:
parent
78b73c0fac
commit
9ef0e6044c
@ -59,14 +59,14 @@ public class PhoneNetworkLocationProvider extends AbstractLocationProvider {
|
|||||||
final LocationManager locationManager = (LocationManager) context.getSystemService(Context.LOCATION_SERVICE);
|
final LocationManager locationManager = (LocationManager) context.getSystemService(Context.LOCATION_SERVICE);
|
||||||
locationManager.removeUpdates(getLocationListener());
|
locationManager.removeUpdates(getLocationListener());
|
||||||
locationManager.requestLocationUpdates(
|
locationManager.requestLocationUpdates(
|
||||||
LocationManager.GPS_PROVIDER,
|
LocationManager.NETWORK_PROVIDER,
|
||||||
interval,
|
interval,
|
||||||
INTERVAL_MIN_DISTANCE,
|
INTERVAL_MIN_DISTANCE,
|
||||||
getLocationListener(),
|
getLocationListener(),
|
||||||
Looper.getMainLooper()
|
Looper.getMainLooper()
|
||||||
);
|
);
|
||||||
|
|
||||||
final Location lastKnownLocation = locationManager.getLastKnownLocation(LocationManager.GPS_PROVIDER);
|
final Location lastKnownLocation = locationManager.getLastKnownLocation(LocationManager.NETWORK_PROVIDER);
|
||||||
LOG.debug("Last known network location: {}", lastKnownLocation);
|
LOG.debug("Last known network location: {}", lastKnownLocation);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user