Merge pull request #8996 from osmandapp/StopAndSaveGPX

Combine Save GPX with Stop action
This commit is contained in:
vshcherb 2020-05-19 17:54:26 +02:00 committed by GitHub
commit 4c34cefc12
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 1 additions and 3 deletions

View file

@ -392,6 +392,7 @@ public class OsmandMonitoringPlugin extends OsmandPlugin {
} }
public void saveCurrentTrack(@Nullable final Runnable onComplete, @Nullable Activity activity) { public void saveCurrentTrack(@Nullable final Runnable onComplete, @Nullable Activity activity) {
stopRecording();
final WeakReference<Activity> activityRef = activity != null ? new WeakReference<>(activity) : null; final WeakReference<Activity> activityRef = activity != null ? new WeakReference<>(activity) : null;

View file

@ -44,9 +44,6 @@ public class GpxNotification extends OsmandNotification {
final OsmandMonitoringPlugin plugin = OsmandPlugin.getEnabledPlugin(OsmandMonitoringPlugin.class); final OsmandMonitoringPlugin plugin = OsmandPlugin.getEnabledPlugin(OsmandMonitoringPlugin.class);
if (plugin != null) { if (plugin != null) {
plugin.saveCurrentTrack(); plugin.saveCurrentTrack();
if (!app.getSettings().SAVE_GLOBAL_TRACK_TO_GPX.get()) {
plugin.stopRecording();
}
} }
} }
}, new IntentFilter(OSMAND_SAVE_GPX_SERVICE_ACTION)); }, new IntentFilter(OSMAND_SAVE_GPX_SERVICE_ACTION));