Formatting

This commit is contained in:
Victor Shcherb 2021-01-07 11:23:24 +01:00
parent 370d8155ee
commit 31ffca2547
2 changed files with 5 additions and 6 deletions

View file

@ -673,15 +673,15 @@ public class OsmAndLocationProvider implements SensorEventListener {
private void stopLocationRequests() {
LocationManager service = (LocationManager) app.getSystemService(Context.LOCATION_SERVICE);
if(gpsStatusListener != null) {
if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
if (gpsStatusListener != null) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
service.unregisterGnssStatusCallback((GnssStatus.Callback) gpsStatusListener);
} else {
service.removeGpsStatusListener((Listener) gpsStatusListener);
}
}
service.removeUpdates(gpsListener);
while(!networkListeners.isEmpty()) {
while (!networkListeners.isEmpty()) {
service.removeUpdates(networkListeners.poll());
}
}
@ -812,8 +812,7 @@ public class OsmAndLocationProvider implements SensorEventListener {
setLocation(location);
}
private void setLocation(net.osmand.Location location) {
if (location == null) {
private void setLocation(net.osmand.Location location) { if (location == null) {
updateGPSInfo(null);
}

View file

@ -73,7 +73,7 @@ public class AnnounceTimeDistances {
// Do not play prepare: for pedestrian and slow transport
// same check as speed < 150/(90-22) m/s = 2.2 m/s = 8 km/h
// if (DEFAULT_SPEED < 2.3) {
// if (DEFAULT_SPEED < 2.3) {
if (PREPARE_DISTANCE_END - TURN_IN_DISTANCE < 150) {
PREPARE_DISTANCE_END = PREPARE_DISTANCE * 2;
}