diff options
| author | Samuel Tardieu <sam@rfc1149.net> | 2014-08-03 17:02:23 +0200 |
|---|---|---|
| committer | Samuel Tardieu <sam@rfc1149.net> | 2014-08-03 17:02:23 +0200 |
| commit | 4c08563f0ba5d84cfbe37707b35f2e22d2c6bd23 (patch) | |
| tree | a1cabe311c71cd8f1c7bfbfca7a83b4291bde5fb /main/src/cgeo/geocaching/sensors | |
| parent | c687d8b70878935ed2fef931b1818c3a3c08d018 (diff) | |
| download | cgeo-4c08563f0ba5d84cfbe37707b35f2e22d2c6bd23.zip cgeo-4c08563f0ba5d84cfbe37707b35f2e22d2c6bd23.tar.gz cgeo-4c08563f0ba5d84cfbe37707b35f2e22d2c6bd23.tar.bz2 | |
Remove special handling of pseudo location
Diffstat (limited to 'main/src/cgeo/geocaching/sensors')
| -rw-r--r-- | main/src/cgeo/geocaching/sensors/GeoData.java | 9 | ||||
| -rw-r--r-- | main/src/cgeo/geocaching/sensors/GeoDataProvider.java | 10 | ||||
| -rw-r--r-- | main/src/cgeo/geocaching/sensors/IGeoData.java | 2 |
3 files changed, 4 insertions, 17 deletions
diff --git a/main/src/cgeo/geocaching/sensors/GeoData.java b/main/src/cgeo/geocaching/sensors/GeoData.java index c0b3974..c0f57b5 100644 --- a/main/src/cgeo/geocaching/sensors/GeoData.java +++ b/main/src/cgeo/geocaching/sensors/GeoData.java @@ -10,14 +10,12 @@ class GeoData extends Location implements IGeoData { private final boolean gpsEnabled; private final int satellitesVisible; private final int satellitesFixed; - private final boolean pseudoLocation; - GeoData(final Location location, final boolean gpsEnabled, final int satellitesVisible, final int satellitesFixed, final boolean pseudoLocation) { + GeoData(final Location location, final boolean gpsEnabled, final int satellitesVisible, final int satellitesFixed) { super(location); this.gpsEnabled = gpsEnabled; this.satellitesVisible = satellitesVisible; this.satellitesFixed = satellitesFixed; - this.pseudoLocation = pseudoLocation; } @Override @@ -59,9 +57,4 @@ class GeoData extends Location implements IGeoData { public int getSatellitesFixed() { return satellitesFixed; } - - @Override - public boolean isPseudoLocation() { - return pseudoLocation; - } } diff --git a/main/src/cgeo/geocaching/sensors/GeoDataProvider.java b/main/src/cgeo/geocaching/sensors/GeoDataProvider.java index a4799cb..50d42db 100644 --- a/main/src/cgeo/geocaching/sensors/GeoDataProvider.java +++ b/main/src/cgeo/geocaching/sensors/GeoDataProvider.java @@ -3,8 +3,6 @@ package cgeo.geocaching.sensors; import cgeo.geocaching.utils.Log; import cgeo.geocaching.utils.StartableHandlerThread; -import org.apache.commons.lang3.StringUtils; - import rx.Observable; import rx.Observable.OnSubscribe; import rx.Subscriber; @@ -29,7 +27,6 @@ import java.util.concurrent.TimeUnit; public class GeoDataProvider implements OnSubscribe<IGeoData> { - private static final String LAST_LOCATION_PSEUDO_PROVIDER = "last"; private final LocationManager geoManager; private final LocationData gpsLocation = new LocationData(); private final LocationData netLocation = new LocationData(); @@ -140,7 +137,7 @@ public class GeoDataProvider implements OnSubscribe<IGeoData> { }; private IGeoData findInitialLocation() { - final Location initialLocation = new Location(LAST_LOCATION_PSEUDO_PROVIDER); + final Location initialLocation = new Location("initial"); try { // Try to find a sensible initial location from the last locations known to Android. final Location lastGpsLocation = geoManager.getLastKnownLocation(LocationManager.GPS_PROVIDER); @@ -167,7 +164,7 @@ public class GeoDataProvider implements OnSubscribe<IGeoData> { } // Start with an historical GeoData just in case someone queries it before we get // a chance to get any information. - return new GeoData(initialLocation, false, 0, 0, true); + return new GeoData(initialLocation, false, 0, 0); } private static void copyCoords(final Location target, final Location source) { @@ -275,8 +272,7 @@ public class GeoDataProvider implements OnSubscribe<IGeoData> { // We do not necessarily get signalled when satellites go to 0/0. final int visible = gpsLocation.isRecent() ? satellitesVisible : 0; - final boolean pseudoLocation = StringUtils.equals(locationData.location.getProvider(), LAST_LOCATION_PSEUDO_PROVIDER); - final IGeoData current = new GeoData(locationData.location, gpsEnabled, visible, satellitesFixed, pseudoLocation); + final IGeoData current = new GeoData(locationData.location, gpsEnabled, visible, satellitesFixed); subject.onNext(current); } diff --git a/main/src/cgeo/geocaching/sensors/IGeoData.java b/main/src/cgeo/geocaching/sensors/IGeoData.java index 5b4f046..3b58d79 100644 --- a/main/src/cgeo/geocaching/sensors/IGeoData.java +++ b/main/src/cgeo/geocaching/sensors/IGeoData.java @@ -10,8 +10,6 @@ public interface IGeoData { public Location getLocation(); public LocationProviderType getLocationProvider(); - public boolean isPseudoLocation(); - public Geopoint getCoords(); public float getBearing(); public float getSpeed(); |
