diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/externalevents/OsmandEventReceiver.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/externalevents/OsmandEventReceiver.java index 5dbb2c8d4..87db2ddc2 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/externalevents/OsmandEventReceiver.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/externalevents/OsmandEventReceiver.java @@ -160,16 +160,17 @@ public class OsmandEventReceiver { } private boolean shouldSendNavigation() { - final Prefs prefs = GBApplication.getPrefs(); + Prefs prefs = GBApplication.getPrefs(); - final boolean navigationForward = prefs.getBoolean("navigation_forward", true); - if (!navigationForward) { + boolean navigationForward = prefs.getBoolean("navigation_forward", true); + boolean navigationOsmAnd = prefs.getBoolean("navigation_app_osmand", true); + if (!navigationForward || !navigationOsmAnd) { return false; } - final boolean navigationScreenOn = prefs.getBoolean("nagivation_screen_on", true); + boolean navigationScreenOn = prefs.getBoolean("nagivation_screen_on", true); if (!navigationScreenOn) { - final PowerManager powermanager = (PowerManager) app.getSystemService(Context.POWER_SERVICE); + PowerManager powermanager = (PowerManager) app.getSystemService(Context.POWER_SERVICE); if (powermanager != null && powermanager.isScreenOn()) { LOG.info("Not forwarding navigation instructions, screen seems to be on and settings do not allow this"); return false; diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/externalevents/notifications/GoogleMapsNotificationHandler.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/externalevents/notifications/GoogleMapsNotificationHandler.java index 0417c53cb..74d68d36d 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/externalevents/notifications/GoogleMapsNotificationHandler.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/externalevents/notifications/GoogleMapsNotificationHandler.java @@ -992,7 +992,8 @@ public class GoogleMapsNotificationHandler { Prefs prefs = GBApplication.getPrefs(); boolean navigationForward = prefs.getBoolean("navigation_forward", true); - if (!navigationForward) { + boolean navigationGMaps = prefs.getBoolean("navigation_app_gmaps", true); + if (!navigationForward || !navigationGMaps) { shouldSendNavigation = false; return; } diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index ac6b5a32e..dbc2399cd 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -2400,4 +2400,8 @@ Prefix notification title with name of source application OsmAnd package name Used for selecting the version of OsmAnd to connect to + Navigation preferences + Navigation apps + OsmAnd(+) + Google Maps diff --git a/app/src/main/res/xml/preferences.xml b/app/src/main/res/xml/preferences.xml index 4d9be5373..f7525a9d3 100644 --- a/app/src/main/res/xml/preferences.xml +++ b/app/src/main/res/xml/preferences.xml @@ -204,28 +204,50 @@ - - - + + + + + + + + +