src/main/java/de/dennisguse/opentracks/services/handlers/GPSHandler.java
@Override
    public void onLocationChanged(@NonNull Location location) {
        if (!isStarted()) {
            Log.w(TAG, "Location is ignored; not started.");
            return;
        }

        TrackPoint trackPoint = new TrackPoint(location, trackPointCreator.createNow());
        boolean isAccurate = trackPoint.fulfillsAccuracy(thresholdHorizontalAccuracy);
        boolean isValid = LocationUtils.isValidLocation(location);

        if (gpsStatus != null) {
            gpsStatus.onLocationChanged(trackPoint);
        }

        if (!isValid) {
            Log.w(TAG, "Ignore newTrackPoint. location is invalid.");
            return;
        }

        if (!isAccurate) {
            Log.d(TAG, "Ignore newTrackPoint. Poor accuracy.");
            return;
        }

        trackPointCreator.onNewTrackPoint(trackPoint);
    }
/**
     * Checks if location is valid and builds a track point that will be send through TrackPointCreator.
     *
     * @param location {@link Location} object.
     */
Checks if location is valid and builds a track point that will be send through TrackPointCreator.
@param location  Location object.
Checks if location is valid and builds a track point that will be send through TrackPointCreator . @param location Location object .
@Override
    public void onLocationChanged(@NonNull Location location) {
        if (!isStarted()) {
            Log.w(TAG, "Location is ignored; not started.");
            return;
        }
        TrackPoint trackPoint = new TrackPoint(location, trackPointCreator.createNow());
        boolean isAccurate = trackPoint.fulfillsAccuracy(thresholdHorizontalAccuracy);
        boolean isValid = LocationUtils.isValidLocation(location);
        if (gpsStatus != null) {
            gpsStatus.onLocationChanged(trackPoint);
        }
        if (!isValid) {
            Log.w(TAG, "Ignore newTrackPoint. location is invalid.");
            return;
        }
        if (!isAccurate) {
            Log.d(TAG, "Ignore newTrackPoint. Poor accuracy.");
            return;
        }
        trackPointCreator.onNewTrackPoint(trackPoint);
    }
@ Override public void onLocationChanged ( @ NonNull Location location ) { if ( ! isStarted ( ) ) { Log . w ( TAG , "Location is ignored; not started." ) ; return ; } TrackPoint trackPoint = new TrackPoint ( location , trackPointCreator . createNow ( ) ) ; boolean isAccurate = trackPoint . fulfillsAccuracy ( thresholdHorizontalAccuracy ) ; boolean isValid = LocationUtils . isValidLocation ( location ) ; if ( gpsStatus != null ) { gpsStatus . onLocationChanged ( trackPoint ) ; } if ( ! isValid ) { Log . w ( TAG , "Ignore newTrackPoint. location is invalid." ) ; return ; } if ( ! isAccurate ) { Log . d ( TAG , "Ignore newTrackPoint. Poor accuracy." ) ; return ; } trackPointCreator . onNewTrackPoint ( trackPoint ) ; }
Checks if location is valid and builds a track point that will be send through TrackPointCreator.
Checks if location is valid and builds a track point that will be send through TrackPointCreator .