Inject A-GPS data if backToLocationImpl fails with no fix
This commit is contained in:
parent
f3dec1c5f7
commit
13d7f80997
1 changed files with 7 additions and 0 deletions
|
@ -29,6 +29,7 @@ import net.osmand.plus.views.OsmandMapTileView;
|
|||
import net.osmand.util.MapUtils;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.text.SimpleDateFormat;
|
||||
|
||||
public class MapViewTrackingUtilities implements OsmAndLocationListener, IMapLocationListener,
|
||||
OsmAndCompassListener, MapMarkerChangedListener {
|
||||
|
@ -361,6 +362,12 @@ public class MapViewTrackingUtilities implements OsmAndLocationListener, IMapLoc
|
|||
}
|
||||
if (location == null) {
|
||||
app.showToastMessage(R.string.unknown_location);
|
||||
|
||||
//Hardy, 2019-12-15: Inject A-GPS data if backToLocationImpl fails with no fix:
|
||||
if (app.getSettings().isInternetConnectionAvailable(true)) {
|
||||
locationProvider.redownloadAGPS();
|
||||
app.showToastMessage(app.getString(R.string.agps_data_last_downloaded, (new SimpleDateFormat("yyyy-MM-dd HH:mm")).format(app.getSettings().AGPS_DATA_LAST_TIME_DOWNLOADED.get())));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue