Merge pull request #5493 from osmandapp/location_provider_fix
Location provider fix
This commit is contained in:
commit
d902888f4a
1 changed files with 20 additions and 20 deletions
|
@ -691,7 +691,8 @@ public class OsmAndLocationProvider implements SensorEventListener {
|
||||||
|
|
||||||
private void scheduleCheckIfGpsLost(final net.osmand.Location location) {
|
private void scheduleCheckIfGpsLost(final net.osmand.Location location) {
|
||||||
final RoutingHelper routingHelper = app.getRoutingHelper();
|
final RoutingHelper routingHelper = app.getRoutingHelper();
|
||||||
if (location != null) {
|
if (location != null && routingHelper.isFollowingMode() && routingHelper.getLeftDistance() > 0
|
||||||
|
&& simulatePosition == null) {
|
||||||
final long fixTime = location.getTime();
|
final long fixTime = location.getTime();
|
||||||
app.runMessageInUIThreadAndCancelPrevious(LOST_LOCATION_MSG_ID, new Runnable() {
|
app.runMessageInUIThreadAndCancelPrevious(LOST_LOCATION_MSG_ID, new Runnable() {
|
||||||
|
|
||||||
|
@ -703,13 +704,13 @@ public class OsmAndLocationProvider implements SensorEventListener {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
gpsSignalLost = true;
|
gpsSignalLost = true;
|
||||||
if (routingHelper.isFollowingMode() && routingHelper.getLeftDistance() > 0) {
|
if (routingHelper.isFollowingMode() && routingHelper.getLeftDistance() > 0
|
||||||
|
&& simulatePosition == null) {
|
||||||
routingHelper.getVoiceRouter().gpsLocationLost();
|
routingHelper.getVoiceRouter().gpsLocationLost();
|
||||||
}
|
|
||||||
setLocation(null);
|
setLocation(null);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}, LOST_LOCATION_CHECK_DELAY);
|
}, LOST_LOCATION_CHECK_DELAY);
|
||||||
if (routingHelper.isFollowingMode() && routingHelper.getLeftDistance() > 0 && simulatePosition == null) {
|
|
||||||
app.runMessageInUIThreadAndCancelPrevious(START_SIMULATE_LOCATION_MSG_ID, new Runnable() {
|
app.runMessageInUIThreadAndCancelPrevious(START_SIMULATE_LOCATION_MSG_ID, new Runnable() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -729,7 +730,6 @@ public class OsmAndLocationProvider implements SensorEventListener {
|
||||||
}, START_LOCATION_SIMULATION_DELAY);
|
}, START_LOCATION_SIMULATION_DELAY);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
public void simulatePosition() {
|
public void simulatePosition() {
|
||||||
app.runMessageInUIThreadAndCancelPrevious(RUN_SIMULATE_LOCATION_MSG_ID, new Runnable() {
|
app.runMessageInUIThreadAndCancelPrevious(RUN_SIMULATE_LOCATION_MSG_ID, new Runnable() {
|
||||||
|
|
Loading…
Reference in a new issue