fix that SERVICE_OFF_INTERVAL for global GPX recording can be overridden by subsequent bg service config
This commit is contained in:
parent
2e360339c8
commit
8716f40f8d
1 changed files with 6 additions and 1 deletions
|
@ -850,7 +850,12 @@ public class OsmandApplication extends Application {
|
||||||
final Intent serviceIntent = new Intent(this, NavigationService.class);
|
final Intent serviceIntent = new Intent(this, NavigationService.class);
|
||||||
serviceIntent.putExtra(NavigationService.USAGE_INTENT, intent);
|
serviceIntent.putExtra(NavigationService.USAGE_INTENT, intent);
|
||||||
if (getNavigationService() == null) {
|
if (getNavigationService() == null) {
|
||||||
getSettings().SERVICE_OFF_INTERVAL.set(0);
|
if (intent == NavigationService.USED_BY_GPX) {
|
||||||
|
//Use pre-selected SERVICE_OFF_INTERVAL for global GPX recording
|
||||||
|
getSettings().SERVICE_OFF_INTERVAL.set();
|
||||||
|
} else {
|
||||||
|
getSettings().SERVICE_OFF_INTERVAL.set(0);
|
||||||
|
}
|
||||||
startService(serviceIntent);
|
startService(serviceIntent);
|
||||||
} else {
|
} else {
|
||||||
getNavigationService().addUsageIntent(intent);
|
getNavigationService().addUsageIntent(intent);
|
||||||
|
|
Loading…
Reference in a new issue