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);
|
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
|
//Use pre-selected SERVICE_OFF_INTERVAL for global GPX recording, else
|
||||||
getSettings().SERVICE_OFF_INTERVAL.set(0);
|
getSettings().SERVICE_OFF_INTERVAL.set(0);
|
||||||
}
|
}
|
||||||
startService(serviceIntent);
|
startService(serviceIntent);
|
||||||
} else {
|
} else {
|
||||||
|
getSettings().SERVICE_OFF_INTERVAL.set(0);
|
||||||
getNavigationService().addUsageIntent(intent);
|
getNavigationService().addUsageIntent(intent);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -83,7 +83,8 @@ public class OsMoControlDevice implements OsMoReactor {
|
||||||
} else if(data.equals("START_TRACKING")) {
|
} else if(data.equals("START_TRACKING")) {
|
||||||
tracker.enableTracker();
|
tracker.enableTracker();
|
||||||
app.startNavigationService(NavigationService.USED_BY_LIVE);
|
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")) {
|
} else if(data.equals("OSMAND_INFO")) {
|
||||||
JSONObject robj = new JSONObject();
|
JSONObject robj = new JSONObject();
|
||||||
try {
|
try {
|
||||||
|
|
|
@ -179,7 +179,8 @@ public class OsMoGroupsActivity extends OsmandExpandableListActivity implements
|
||||||
osMoPlugin.getTracker().enableTracker();
|
osMoPlugin.getTracker().enableTracker();
|
||||||
}
|
}
|
||||||
app.startNavigationService(NavigationService.USED_BY_LIVE);
|
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 {
|
} else {
|
||||||
if (osMoPlugin != null && osMoPlugin.getTracker() != null){
|
if (osMoPlugin != null && osMoPlugin.getTracker() != null){
|
||||||
osMoPlugin.getTracker().disableTracker();
|
osMoPlugin.getTracker().disableTracker();
|
||||||
|
|
Loading…
Reference in a new issue