GpsStatusManager should be running in on Thread alone.

This commit is contained in:
Dennis Guse
2023-08-09 19:58:18 +02:00
parent 4d5c59be96
commit f6e8a44a8b
@@ -37,9 +37,6 @@ class GpsStatusManager {
@Nullable
private TrackPoint lastTrackPoint = null;
// Flag to prevent GpsStatus checks two or more locations at the same time.
private boolean checking = false;
private Handler handler;
public final Runnable gpsStatusTimer = () -> {
@@ -87,18 +84,10 @@ class GpsStatusManager {
* Receive new trackPoint and calculate the new status if needed.
* It look for GPS changes in lastLocation if it's not null. If it's null then look for in lastValidLocation if any.
*/
//TODO Remove checking; should be synchronized if this is a problem.
public void onNewTrackPoint(@NonNull final TrackPoint trackPoint) {
if (checking) {
return;
}
checking = true;
lastTrackPoint = trackPoint;
determineGpsStatusOnTrackpoint(trackPoint);
checking = false;
}
/**