From f05051eeaa372ac46e6f6b732030e09acaef57c1 Mon Sep 17 00:00:00 2001 From: sonora Date: Wed, 27 Aug 2014 20:51:36 +0200 Subject: [PATCH] use value "continuous" for wake-up interval 0 --- OsmAnd/src/net/osmand/plus/NavigationService.java | 4 +++- OsmAnd/src/net/osmand/plus/OsmandApplication.java | 6 ++++-- .../osmand/plus/views/mapwidgets/MapInfoWidgetsFactory.java | 4 +++- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/NavigationService.java b/OsmAnd/src/net/osmand/plus/NavigationService.java index 4bf11e0c4d..961f379333 100644 --- a/OsmAnd/src/net/osmand/plus/NavigationService.java +++ b/OsmAnd/src/net/osmand/plus/NavigationService.java @@ -198,7 +198,9 @@ public class NavigationService extends Service implements LocationListener { //Show currently active wake-up interval int soi = settings.SERVICE_OFF_INTERVAL.get(); String nt = getString(R.string.service_stop_background_service) + ". " + getString(R.string.gps_wake_up_timer) + ": "; - if (soi <= 90000) { + if (soi == 0) { + nt = nt + getString(R.string.int_continuosly)); + } else if (soi <= 90000) { nt = nt + Integer.toString(soi/1000) + " " + getString(R.string.int_seconds); } else { nt = nt + Integer.toString(soi/1000/60) + " " + getString(R.string.int_min); diff --git a/OsmAnd/src/net/osmand/plus/OsmandApplication.java b/OsmAnd/src/net/osmand/plus/OsmandApplication.java index f640110cad..3a9370353f 100644 --- a/OsmAnd/src/net/osmand/plus/OsmandApplication.java +++ b/OsmAnd/src/net/osmand/plus/OsmandApplication.java @@ -850,8 +850,10 @@ public class OsmandApplication extends Application { final Intent serviceIntent = new Intent(this, NavigationService.class); 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, else + if (intent == NavigationService.USED_BY_GPX) { + //Use pre-selected SERVICE_OFF_INTERVAL for global GPX recording, else + getSettings().SERVICE_OFF_INTERVAL.set(); + } else { getSettings().SERVICE_OFF_INTERVAL.set(0); } startService(serviceIntent); diff --git a/OsmAnd/src/net/osmand/plus/views/mapwidgets/MapInfoWidgetsFactory.java b/OsmAnd/src/net/osmand/plus/views/mapwidgets/MapInfoWidgetsFactory.java index 248b3023d9..90cd25b332 100644 --- a/OsmAnd/src/net/osmand/plus/views/mapwidgets/MapInfoWidgetsFactory.java +++ b/OsmAnd/src/net/osmand/plus/views/mapwidgets/MapInfoWidgetsFactory.java @@ -105,7 +105,9 @@ public class MapInfoWidgetsFactory { //Show currently active wake-up interval int soi = app.getSettings().SERVICE_OFF_INTERVAL.get(); - if (soi <= 90000) { + if (soi == 0) { + dlg.setMessage(app.getString(R.string.gps_wake_up_timer) + ": " + app.getString(R.string.int_continuosly)); + } else if (soi <= 90000) { dlg.setMessage(app.getString(R.string.gps_wake_up_timer) + ": " + Integer.toString(soi/1000) + " " + app.getString(R.string.int_seconds)); } else { dlg.setMessage(app.getString(R.string.gps_wake_up_timer) + ": " + Integer.toString(soi/1000/60) + " " + app.getString(R.string.int_min));