forked from upstream-mirrors/OpenTracks
Cleanup.
This commit is contained in:
@@ -28,7 +28,7 @@ To show your tracks on a map, a 3rd party application (e.g., [OsmAnd](https://pl
|
|||||||
|
|
||||||
## Project history
|
## Project history
|
||||||
|
|
||||||
_OpenTracks_ is based upon Google _My Tracks app_ ([code](https://code.google.com/archive/p/mytracks/).
|
_OpenTracks_ is based upon Google _My Tracks app_ ([code](https://code.google.com/archive/p/mytracks/)).
|
||||||
Initially, _My Tracks_ was initially released by Google in 2010 as [open-source software](http://google-latlong.blogspot.fr/2010/05/code-for-my-tracks-is-now-yours.html).
|
Initially, _My Tracks_ was initially released by Google in 2010 as [open-source software](http://google-latlong.blogspot.fr/2010/05/code-for-my-tracks-is-now-yours.html).
|
||||||
In 2016, [Google decided to discontinue](https://support.google.com/maps/answer/6333516) _My Tracks_ and stopped distributing it via the Google Play store in April 2016.
|
In 2016, [Google decided to discontinue](https://support.google.com/maps/answer/6333516) _My Tracks_ and stopped distributing it via the Google Play store in April 2016.
|
||||||
The [Plonk42](https://github.com/plonk42) conducted some maintenance work until 2016, so _My Tracks_ could still be used (based upon version _Google's MyTracks_ version 2.0.6).
|
The [Plonk42](https://github.com/plonk42) conducted some maintenance work until 2016, so _My Tracks_ could still be used (based upon version _Google's MyTracks_ version 2.0.6).
|
||||||
|
|||||||
@@ -197,9 +197,8 @@ public class SaveAsyncTask extends AsyncTask<Void, Integer, Boolean> {
|
|||||||
|
|
||||||
String fileName = FileUtils.buildUniqueFileName(directory, track.getName(), extension);
|
String fileName = FileUtils.buildUniqueFileName(directory, track.getName(), extension);
|
||||||
File file = new File(directory, fileName);
|
File file = new File(directory, fileName);
|
||||||
FileOutputStream fileOutputStream = null;
|
|
||||||
try {
|
try (FileOutputStream fileOutputStream = new FileOutputStream(file)) {
|
||||||
fileOutputStream = new FileOutputStream(file);
|
|
||||||
if (trackExporter.writeTrack(fileOutputStream)) {
|
if (trackExporter.writeTrack(fileOutputStream)) {
|
||||||
savedPath = file.getAbsolutePath();
|
savedPath = file.getAbsolutePath();
|
||||||
return true;
|
return true;
|
||||||
@@ -213,14 +212,9 @@ public class SaveAsyncTask extends AsyncTask<Void, Integer, Boolean> {
|
|||||||
} catch (FileNotFoundException e) {
|
} catch (FileNotFoundException e) {
|
||||||
Log.e(TAG, "Unable to open file " + file.getName(), e);
|
Log.e(TAG, "Unable to open file " + file.getName(), e);
|
||||||
return false;
|
return false;
|
||||||
} finally {
|
} catch (IOException e) {
|
||||||
if (fileOutputStream != null) {
|
Log.e(TAG, "Unable to close file output stream", e);
|
||||||
try {
|
return false;
|
||||||
fileOutputStream.close();
|
|
||||||
} catch (IOException e) {
|
|
||||||
Log.e(TAG, "Unable to close file output stream", e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user