diff --git a/OsmAnd/src/net/osmand/plus/OsmandSettings.java b/OsmAnd/src/net/osmand/plus/OsmandSettings.java index a631100e19..ea14d27611 100644 --- a/OsmAnd/src/net/osmand/plus/OsmandSettings.java +++ b/OsmAnd/src/net/osmand/plus/OsmandSettings.java @@ -1099,6 +1099,7 @@ public class OsmandSettings { public final OsmandPreference SPEAK_PEDESTRIAN = new BooleanPreference("speak_pedestrian", true).makeProfile().cache(); public final OsmandPreference SPEAK_SPEED_LIMIT = new BooleanPreference("speak_speed_limit", true).makeProfile().cache(); public final OsmandPreference SPEAK_SPEED_CAMERA = new BooleanPreference("speak_cameras", false).makeProfile().cache(); + public final OsmandPreference SPEAK_TUNNELS = new BooleanPreference("speak_tunnels", false).makeProfile().cache(); public final OsmandPreference ANNOUNCE_WPT = new BooleanPreference("announce_wpt", true).makeGlobal().cache(); public final OsmandPreference ANNOUNCE_NEARBY_FAVORITES = new BooleanPreference("announce_nearby_favorites", false).makeProfile().cache(); public final OsmandPreference ANNOUNCE_NEARBY_POI = new BooleanPreference("announce_nearby_poi", false).makeProfile().cache(); diff --git a/OsmAnd/src/net/osmand/plus/activities/SettingsNavigationActivity.java b/OsmAnd/src/net/osmand/plus/activities/SettingsNavigationActivity.java index f088cfb2fb..32b056682e 100644 --- a/OsmAnd/src/net/osmand/plus/activities/SettingsNavigationActivity.java +++ b/OsmAnd/src/net/osmand/plus/activities/SettingsNavigationActivity.java @@ -636,11 +636,12 @@ public class SettingsNavigationActivity extends SettingsBaseActivity { } else if (preference == speakAlarms) { AlertDialog dlg = showBooleanSettings(new String[] { getString(R.string.speak_street_names), getString(R.string.speak_traffic_warnings), getString(R.string.speak_pedestrian), - getString(R.string.speak_speed_limit), getString(R.string.speak_cameras), + getString(R.string.speak_speed_limit), getString(R.string.speak_cameras), getString(R.string.show_tunnels), getString(R.string.announce_gpx_waypoints), getString(R.string.speak_favorites), getString(R.string.speak_poi) }, new OsmandPreference[] { settings.SPEAK_STREET_NAMES, settings.SPEAK_TRAFFIC_WARNINGS, settings.SPEAK_PEDESTRIAN, settings.SPEAK_SPEED_LIMIT, - settings.SPEAK_SPEED_CAMERA, settings.ANNOUNCE_WPT, settings.ANNOUNCE_NEARBY_FAVORITES, + settings.SPEAK_SPEED_CAMERA, settings.SPEAK_TUNNELS, + settings.ANNOUNCE_WPT, settings.ANNOUNCE_NEARBY_FAVORITES, settings.ANNOUNCE_NEARBY_POI }, preference.getTitle()); final boolean initialSpeedCam = settings.SPEAK_SPEED_CAMERA.get(); final boolean initialFavorites = settings.ANNOUNCE_NEARBY_FAVORITES.get(); diff --git a/OsmAnd/src/net/osmand/plus/helpers/WaypointHelper.java b/OsmAnd/src/net/osmand/plus/helpers/WaypointHelper.java index fef53f115d..266e034af1 100644 --- a/OsmAnd/src/net/osmand/plus/helpers/WaypointHelper.java +++ b/OsmAnd/src/net/osmand/plus/helpers/WaypointHelper.java @@ -219,6 +219,8 @@ public class WaypointHelper { app.getSettings().SPEAK_TRAFFIC_WARNINGS.setModeValue(appMode, enable); app.getSettings().SHOW_PEDESTRIAN.setModeValue(appMode, enable); app.getSettings().SPEAK_PEDESTRIAN.setModeValue(appMode, enable); + app.getSettings().SHOW_TUNNELS.setModeValue(appMode, enable); + app.getSettings().SPEAK_TUNNELS.setModeValue(appMode, enable); //But do not implicitly change speed_cam settings here because of legal restrictions in some countries, so Nav settings must prevail } else if (type == POI) { app.getSettings().SHOW_NEARBY_POI.setModeValue(appMode, enable); diff --git a/OsmAnd/src/net/osmand/plus/routing/VoiceRouter.java b/OsmAnd/src/net/osmand/plus/routing/VoiceRouter.java index b1ac9d9a85..af27e575ea 100644 --- a/OsmAnd/src/net/osmand/plus/routing/VoiceRouter.java +++ b/OsmAnd/src/net/osmand/plus/routing/VoiceRouter.java @@ -349,6 +349,14 @@ public class VoiceRouter { p.attention(type+"").play(); } } + } else if (type == AlarmInfoType.TUNNEL) { + if (router.getSettings().SPEAK_TUNNELS.get()) { + CommandBuilder p = getNewCommandPlayerToPlay(); + if (p != null) { + notifyOnVoiceMessage(); + p.attention(type+"").play(); + } + } } else { if (router.getSettings().SPEAK_TRAFFIC_WARNINGS.get()) { CommandBuilder p = getNewCommandPlayerToPlay();