diff --git a/OsmAnd/src/net/osmand/plus/notifications/GpxNotification.java b/OsmAnd/src/net/osmand/plus/notifications/GpxNotification.java index c56b92027b..bd2c9df427 100644 --- a/OsmAnd/src/net/osmand/plus/notifications/GpxNotification.java +++ b/OsmAnd/src/net/osmand/plus/notifications/GpxNotification.java @@ -103,6 +103,11 @@ public class GpxNotification extends OsmandNotification { return new Intent(app, MapActivity.class); } + @Override + public boolean isUpdateDisabled() { + return app.getSettings().MAP_ACTIVITY_ENABLED.get() && !app.getSettings().SHOW_TRIP_REC_NOTIFICATION.get(); + } + @Override public void onNotificationDismissed() { if (!wasNoDataDismissed) { diff --git a/OsmAnd/src/net/osmand/plus/notifications/NavigationNotification.java b/OsmAnd/src/net/osmand/plus/notifications/NavigationNotification.java index c75aadd412..47e7849316 100644 --- a/OsmAnd/src/net/osmand/plus/notifications/NavigationNotification.java +++ b/OsmAnd/src/net/osmand/plus/notifications/NavigationNotification.java @@ -114,6 +114,11 @@ public class NavigationNotification extends OsmandNotification { || (routingHelper.isRoutePlanningMode() && routingHelper.isPauseNavigation()); } + @Override + public boolean isUpdateDisabled() { + return app.getSettings().MAP_ACTIVITY_ENABLED.get() && !app.getSettings().SHOW_NAVIGATION_NOTIFICATION.get(); + } + @Override public Intent getContentIntent() { return new Intent(app, MapActivity.class); @@ -121,7 +126,7 @@ public class NavigationNotification extends OsmandNotification { @Override public Builder buildNotification(boolean wearable) { - if (!isEnabled() || !app.getSettings().SHOW_NAVIGATION_NOTIFICATION.get()) { + if (!isEnabled()) { return null; } NavigationService service = app.getNavigationService(); diff --git a/OsmAnd/src/net/osmand/plus/notifications/OsmandNotification.java b/OsmAnd/src/net/osmand/plus/notifications/OsmandNotification.java index 30ed6236ed..6e24cc370c 100644 --- a/OsmAnd/src/net/osmand/plus/notifications/OsmandNotification.java +++ b/OsmAnd/src/net/osmand/plus/notifications/OsmandNotification.java @@ -11,7 +11,6 @@ import android.support.v4.app.NotificationManagerCompat; import net.osmand.plus.NotificationHelper; import net.osmand.plus.OsmandApplication; -import net.osmand.plus.activities.MapActivity; public abstract class OsmandNotification { @@ -105,6 +104,8 @@ public abstract class OsmandNotification { public abstract boolean isEnabled(); + public abstract boolean isUpdateDisabled(); + public abstract Intent getContentIntent(); public void setupNotification(Notification notification) { @@ -125,7 +126,7 @@ public abstract class OsmandNotification { NotificationManagerCompat notificationManager = NotificationManagerCompat.from(app); if (isEnabled()) { Builder notificationBuilder = buildNotification(false); - if (notificationBuilder != null) { + if (notificationBuilder != null && !isUpdateDisabled()) { Notification notification = getNotification(notificationBuilder, false); setupNotification(notification); notificationManager.notify(top ? TOP_NOTIFICATION_SERVICE_ID : getOsmandNotificationId(), notification); @@ -141,6 +142,9 @@ public abstract class OsmandNotification { if (isEnabled()) { Builder notificationBuilder = buildNotification(false); if (notificationBuilder != null) { + if (isUpdateDisabled()) { + return false; + } Notification notification = getNotification(notificationBuilder, true); setupNotification(notification); if (top) {