Fix #2415
This commit is contained in:
parent
0570e87207
commit
e8fc3aa8a1
1 changed files with 7 additions and 3 deletions
|
@ -729,11 +729,15 @@ public class OsmandApplication extends MultiDexApplication {
|
||||||
|
|
||||||
public void startNavigationService(int intent, int interval) {
|
public void startNavigationService(int intent, int interval) {
|
||||||
final Intent serviceIntent = new Intent(this, NavigationService.class);
|
final Intent serviceIntent = new Intent(this, NavigationService.class);
|
||||||
|
|
||||||
|
if (getNavigationService() != null) {
|
||||||
|
intent |= getNavigationService().getUsedBy();
|
||||||
|
interval = Math.min(getNavigationService().getServiceOffInterval(), interval);
|
||||||
|
getNavigationService().stopSelf();
|
||||||
|
|
||||||
|
}
|
||||||
serviceIntent.putExtra(NavigationService.USAGE_INTENT, intent);
|
serviceIntent.putExtra(NavigationService.USAGE_INTENT, intent);
|
||||||
serviceIntent.putExtra(NavigationService.USAGE_OFF_INTERVAL, interval);
|
serviceIntent.putExtra(NavigationService.USAGE_OFF_INTERVAL, interval);
|
||||||
if (getNavigationService() != null) {
|
|
||||||
getNavigationService().stopSelf();
|
|
||||||
}
|
|
||||||
startService(serviceIntent);
|
startService(serviceIntent);
|
||||||
getNotificationHelper().showNotification();
|
getNotificationHelper().showNotification();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue