Merge remote-tracking branch 'origin/master'

This commit is contained in:
Weblate 2016-07-11 22:44:02 +02:00
commit 76c6095c7a
3 changed files with 11 additions and 1 deletions

View file

@ -263,6 +263,7 @@ public abstract class AbstractPrologCommandPlayer implements CommandPlayer, Stat
public void clear() {
if(ctx != null && ctx.getSettings() != null) {
ctx.getSettings().APPLICATION_MODE.removeListener(this);
abandonAudioFocus();
}
ctx = null;
prologSystem = null;

View file

@ -55,6 +55,9 @@ public class MediaCommandPlayerImpl extends AbstractPrologCommandPlayer implemen
if (mediaPlayer != null){
mediaPlayer.stop();
}
if (ctx != null) {
abandonAudioFocus();
}
}
// Called from the calculating route thread.

View file

@ -123,7 +123,7 @@ public class TTSCommandPlayerImpl extends AbstractPrologCommandPlayer {
params.put(TextToSpeech.Engine.KEY_PARAM_UTTERANCE_ID,""+System.currentTimeMillis());
mTts.speak(bld.toString(), TextToSpeech.QUEUE_ADD, params);
// Audio focus will be released when onUtteranceCompleted() completed is called by the TTS engine.
} else {
} else if (ctx != null) {
sendAlertToAndroidWear(ctx, bld.toString());
}
}
@ -134,6 +134,9 @@ public class TTSCommandPlayerImpl extends AbstractPrologCommandPlayer {
mTts.stop();
}
ttsRequests = 0;
if (ctx != null) {
abandonAudioFocus();
}
}
public void sendAlertToPebble(String bld) {
@ -243,6 +246,9 @@ public class TTSCommandPlayerImpl extends AbstractPrologCommandPlayer {
mTtsContext = null;
ttsRequests = 0;
speechAllowed = false;
if (ctx != null) {
abandonAudioFocus();
}
}
@Override