test longer SERVICE_OFF_INTERVALs for longer global GPX recording intervals

This commit is contained in:
sonora 2014-08-27 21:08:19 +02:00
parent d625d9a292
commit 07ab3ecb00
2 changed files with 11 additions and 5 deletions

View file

@ -851,7 +851,12 @@ public class OsmandApplication extends Application {
serviceIntent.putExtra(NavigationService.USAGE_INTENT, intent); serviceIntent.putExtra(NavigationService.USAGE_INTENT, intent);
if (getNavigationService() == null) { if (getNavigationService() == null) {
if (intent == NavigationService.USED_BY_GPX) { if (intent == NavigationService.USED_BY_GPX) {
//Use pre-selected SERVICE_OFF_INTERVAL for global GPX recording, else if (settings.SAVE_GLOBAL_TRACK_INTERVAL.set() < 30000) {
settings.SERVICE_OFF_INTERVAL.set(0);
} else {
//Use SERVICE_OFF_INTERVAL > 0 to conserve power for longer GPX recording intervals
settings.SERVICE_OFF_INTERVAL.set(settings.SAVE_GLOBAL_TRACK_INTERVAL.set());
}
getSettings().SERVICE_OFF_INTERVAL.set(); getSettings().SERVICE_OFF_INTERVAL.set();
} else { } else {
getSettings().SERVICE_OFF_INTERVAL.set(0); getSettings().SERVICE_OFF_INTERVAL.set(0);

View file

@ -333,7 +333,7 @@ public class OsmandMonitoringPlugin extends OsmandPlugin implements MonitoringIn
bld.show(); bld.show();
} }
} }
private void startGPXMonitoring(MapActivity map) { private void startGPXMonitoring(MapActivity map) {
app.getSavingTrackHelper().startNewSegment(); app.getSavingTrackHelper().startNewSegment();
final ValueHolder<Integer> vs = new ValueHolder<Integer>(); final ValueHolder<Integer> vs = new ValueHolder<Integer>();
@ -345,9 +345,10 @@ public class OsmandMonitoringPlugin extends OsmandPlugin implements MonitoringIn
settings.SAVE_GLOBAL_TRACK_INTERVAL.set(vs.value); settings.SAVE_GLOBAL_TRACK_INTERVAL.set(vs.value);
settings.SAVE_GLOBAL_TRACK_TO_GPX.set(true); settings.SAVE_GLOBAL_TRACK_TO_GPX.set(true);
settings.SAVE_GLOBAL_TRACK_REMEMBER.set(choice.value); settings.SAVE_GLOBAL_TRACK_REMEMBER.set(choice.value);
if (app.getNavigationService() == null) { //interval setting not needed here, handled centrally in app.startNavigationService
settings.SERVICE_OFF_INTERVAL.set(0); //if (app.getNavigationService() == null) {
} // settings.SERVICE_OFF_INTERVAL.set(0);
//}
app.startNavigationService(NavigationService.USED_BY_GPX); app.startNavigationService(NavigationService.USED_BY_GPX);
} }
}; };