Inject A-GPS data if backToLocationImpl fails with no fix

This commit is contained in:
Hardy 2019-12-15 13:03:02 +01:00 committed by GitHub
parent f3dec1c5f7
commit 13d7f80997
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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())));
}
}
}
}