aboutsummaryrefslogtreecommitdiffstats
path: root/main
diff options
context:
space:
mode:
authorSamuel Tardieu <sam@rfc1149.net>2012-04-27 12:10:35 +0200
committerSamuel Tardieu <sam@rfc1149.net>2012-04-27 12:10:35 +0200
commita5780d1ac9c147a2f9aeb862bddc93fe1394d387 (patch)
treed83dcd39ee14f7fcbb91067efb7b8c32bae99fea /main
parente4e74eb2cef9bb3e4628b96e9b0b6c517fa0acd0 (diff)
downloadcgeo-a5780d1ac9c147a2f9aeb862bddc93fe1394d387.zip
cgeo-a5780d1ac9c147a2f9aeb862bddc93fe1394d387.tar.gz
cgeo-a5780d1ac9c147a2f9aeb862bddc93fe1394d387.tar.bz2
Now that GeoDataProvider lives forever, don't persist data
Data was persisted because cgGeo objects could be created and destroyed at will, even though only one existed at a time. This is no longer needed here.
Diffstat (limited to 'main')
-rw-r--r--main/src/cgeo/geocaching/GeoDataProvider.java18
-rw-r--r--main/src/cgeo/geocaching/cgeoapplication.java8
2 files changed, 0 insertions, 26 deletions
diff --git a/main/src/cgeo/geocaching/GeoDataProvider.java b/main/src/cgeo/geocaching/GeoDataProvider.java
index fe942c4..500843c 100644
--- a/main/src/cgeo/geocaching/GeoDataProvider.java
+++ b/main/src/cgeo/geocaching/GeoDataProvider.java
@@ -163,7 +163,6 @@ class GeoDataProvider extends MemorySubject<IGeoData> {
*/
public GeoDataProvider(final cgeoapplication app) {
geoManager = (LocationManager) app.getSystemService(Context.LOCATION_SERVICE);
- restoreLastLocation();
this.app = app;
unregisterer.start();
// Start with an empty GeoData just in case someone queries it before we get
@@ -351,7 +350,6 @@ class GeoDataProvider extends MemorySubject<IGeoData> {
}
current.coordsNow = new Geopoint(current.location.getLatitude(), current.location.getLongitude());
- cgeoapplication.getInstance().setLastCoords(current.coordsNow);
final Location location = current.location;
final LocationProviderType locationProvider = current.locationProvider;
@@ -368,20 +366,4 @@ class GeoDataProvider extends MemorySubject<IGeoData> {
}
}
- private void restoreLastLocation() {
- // restore from last location (stored by app)
- assignLastLocation(cgeoapplication.getInstance().getLastCoords());
-
- // restore from last location (stored by device sensors)
- for (final String provider : new String[] { LocationManager.GPS_PROVIDER, LocationManager.NETWORK_PROVIDER }) {
- final Location lastLocation = geoManager.getLastKnownLocation(provider);
- if (lastLocation != null) {
- lastLocation.setProvider(LAST_LOCATION_PSEUDO_PROVIDER);
- assign(lastLocation);
-
- Log.i("Using last location from " + provider);
- break;
- }
- }
- }
}
diff --git a/main/src/cgeo/geocaching/cgeoapplication.java b/main/src/cgeo/geocaching/cgeoapplication.java
index 7cd67bb..5b105cf 100644
--- a/main/src/cgeo/geocaching/cgeoapplication.java
+++ b/main/src/cgeo/geocaching/cgeoapplication.java
@@ -375,14 +375,6 @@ public class cgeoapplication extends Application {
return StringUtils.defaultString(action);
}
- public void setLastCoords(final Geopoint coords) {
- lastCoords = coords;
- }
-
- public Geopoint getLastCoords() {
- return lastCoords;
- }
-
/** {@link cgData#saveLogOffline(String, Date, LogType, String)} */
public boolean saveLogOffline(String geocode, Date date, LogType logtype, String log) {
return storage.saveLogOffline(geocode, date, logtype, log);