forked from upstream-mirrors/OpenTracks
Filtering out non-GPS updates
This commit is contained in:
@@ -508,8 +508,7 @@ public class MapActivity extends com.google.android.maps.MapActivity
|
|||||||
@Override
|
@Override
|
||||||
public void onCurrentLocationChanged(Location location) {
|
public void onCurrentLocationChanged(Location location) {
|
||||||
if (!location.getProvider().equals(LocationManager.GPS_PROVIDER)) {
|
if (!location.getProvider().equals(LocationManager.GPS_PROVIDER)) {
|
||||||
Log.d(TAG,
|
return;
|
||||||
"MapActivity: Network location update received (provider '" + location.getProvider() + "'.");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
currentLocation = location;
|
currentLocation = location;
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ import com.google.android.maps.mytracks.R;
|
|||||||
|
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.location.Location;
|
import android.location.Location;
|
||||||
|
import android.location.LocationManager;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.util.DisplayMetrics;
|
import android.util.DisplayMetrics;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
@@ -260,6 +261,10 @@ public class StatsActivity extends Activity implements TrackDataListener {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onCurrentLocationChanged(final Location loc) {
|
public void onCurrentLocationChanged(final Location loc) {
|
||||||
|
if (!loc.getProvider().equals(LocationManager.GPS_PROVIDER)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (dataHub.isRecordingSelected()) {
|
if (dataHub.isRecordingSelected()) {
|
||||||
runOnUiThread(new Runnable() {
|
runOnUiThread(new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
Reference in New Issue
Block a user