diff --git a/OsmAnd/src/net/osmand/plus/OsmandApplication.java b/OsmAnd/src/net/osmand/plus/OsmandApplication.java index cf4d58233f..f6a032f856 100644 --- a/OsmAnd/src/net/osmand/plus/OsmandApplication.java +++ b/OsmAnd/src/net/osmand/plus/OsmandApplication.java @@ -410,9 +410,6 @@ public class OsmandApplication extends MultiDexApplication { } } else { - // Test for Issues #1351 and #2810 - //player = null; - if (player == null || !Algorithms.objectEquals(voiceProvider, player.getCurrentVoice()) || force) { appInitializer.initVoiceDataInDifferentThread(uiContext, voiceProvider, run, showDialog); } diff --git a/OsmAnd/src/net/osmand/plus/voice/MediaCommandPlayerImpl.java b/OsmAnd/src/net/osmand/plus/voice/MediaCommandPlayerImpl.java index f01124f48f..0ec76cf37c 100644 --- a/OsmAnd/src/net/osmand/plus/voice/MediaCommandPlayerImpl.java +++ b/OsmAnd/src/net/osmand/plus/voice/MediaCommandPlayerImpl.java @@ -61,6 +61,11 @@ public class MediaCommandPlayerImpl extends AbstractPrologCommandPlayer implemen if (mediaPlayer != null){ mediaPlayer.stop(); } + // TODO: Issue #2810: Audio focus issues when ongoing prompt is interrupted by stop(), i.e. when off-route is detected. Temp workaround is to nullify and always re-init player. + //if (ctx != null && ctx.getSettings().AUDIO_STREAM_GUIDANCE.get() == 0) { + mediaPlayer.release(); + mediaPlayer = null; + //} if (ctx != null) { abandonAudioFocus(); } diff --git a/OsmAnd/src/net/osmand/plus/voice/TTSCommandPlayerImpl.java b/OsmAnd/src/net/osmand/plus/voice/TTSCommandPlayerImpl.java index 79453d6490..a72e7dc179 100644 --- a/OsmAnd/src/net/osmand/plus/voice/TTSCommandPlayerImpl.java +++ b/OsmAnd/src/net/osmand/plus/voice/TTSCommandPlayerImpl.java @@ -134,6 +134,10 @@ public class TTSCommandPlayerImpl extends AbstractPrologCommandPlayer { if (mTts != null){ mTts.stop(); } + // TODO: Issue #2810: Audio focus issues when ongoing prompt is interrupted by stop(), i.e. when off-route is detected. Temp workaround is to nullify and always re-init player. + //if (ctx != null && ctx.getSettings().AUDIO_STREAM_GUIDANCE.get() == 0) { + mTts = null; + //} if (ctx != null) { abandonAudioFocus(); }