mirror of
https://github.com/russok/FitoTrack.git
synced 2025-10-28 16:22:12 -07:00
Bug
This commit is contained in:
parent
9e893c5fad
commit
c708a8cc7e
@ -64,7 +64,7 @@ public class WorkoutRecorder implements LocationListener.LocationChangeListener
|
|||||||
|
|
||||||
private static final double SIGNAL_BAD_THRESHOLD= 20; // In meters
|
private static final double SIGNAL_BAD_THRESHOLD= 20; // In meters
|
||||||
private static final int SIGNAL_LOST_THRESHOLD= 10000; // In milliseconds
|
private static final int SIGNAL_LOST_THRESHOLD= 10000; // In milliseconds
|
||||||
private Location lastFix;
|
private Location lastFix= null;
|
||||||
private GpsStateChangedListener gpsStateChangedListener;
|
private GpsStateChangedListener gpsStateChangedListener;
|
||||||
private GpsState gpsState= GpsState.SIGNAL_LOST;
|
private GpsState gpsState= GpsState.SIGNAL_LOST;
|
||||||
|
|
||||||
@ -127,6 +127,9 @@ public class WorkoutRecorder implements LocationListener.LocationChangeListener
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void checkSignalState(){
|
private void checkSignalState(){
|
||||||
|
if(lastFix==null){
|
||||||
|
return;
|
||||||
|
}
|
||||||
GpsState state;
|
GpsState state;
|
||||||
if(System.currentTimeMillis() - lastFix.getTime() > SIGNAL_LOST_THRESHOLD){
|
if(System.currentTimeMillis() - lastFix.getTime() > SIGNAL_LOST_THRESHOLD){
|
||||||
state= GpsState.SIGNAL_LOST;
|
state= GpsState.SIGNAL_LOST;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user