streamline code setting SERVICE_OFF_INTERVAL
This commit is contained in:
parent
bc6ec22a6d
commit
61dbdf81ce
3 changed files with 6 additions and 3 deletions
|
@ -851,11 +851,12 @@ public class OsmandApplication extends Application {
|
|||
serviceIntent.putExtra(NavigationService.USAGE_INTENT, intent);
|
||||
if (getNavigationService() == null) {
|
||||
if (intent != NavigationService.USED_BY_GPX) {
|
||||
//Use pre-selected SERVICE_OFF_INTERVAL for global GPX recording
|
||||
//Use pre-selected SERVICE_OFF_INTERVAL for global GPX recording, else
|
||||
getSettings().SERVICE_OFF_INTERVAL.set(0);
|
||||
}
|
||||
startService(serviceIntent);
|
||||
} else {
|
||||
getSettings().SERVICE_OFF_INTERVAL.set(0);
|
||||
getNavigationService().addUsageIntent(intent);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -83,7 +83,8 @@ public class OsMoControlDevice implements OsMoReactor {
|
|||
} else if(data.equals("START_TRACKING")) {
|
||||
tracker.enableTracker();
|
||||
app.startNavigationService(NavigationService.USED_BY_LIVE);
|
||||
app.getSettings().SERVICE_OFF_INTERVAL.set(0);
|
||||
//interval setting not needed here, handled centrally in app.startNavigationService
|
||||
//app.getSettings().SERVICE_OFF_INTERVAL.set(0);
|
||||
} else if(data.equals("OSMAND_INFO")) {
|
||||
JSONObject robj = new JSONObject();
|
||||
try {
|
||||
|
|
|
@ -179,7 +179,8 @@ public class OsMoGroupsActivity extends OsmandExpandableListActivity implements
|
|||
osMoPlugin.getTracker().enableTracker();
|
||||
}
|
||||
app.startNavigationService(NavigationService.USED_BY_LIVE);
|
||||
app.getSettings().SERVICE_OFF_INTERVAL.set(0);
|
||||
//interval setting not needed here, handled centrally in app.startNavigationService
|
||||
//app.getSettings().SERVICE_OFF_INTERVAL.set(0);
|
||||
} else {
|
||||
if (osMoPlugin != null && osMoPlugin.getTracker() != null){
|
||||
osMoPlugin.getTracker().disableTracker();
|
||||
|
|
Loading…
Reference in a new issue