diff --git a/src/main/java/eu/siacs/conversations/xmpp/jingle/ToneManager.java b/src/main/java/eu/siacs/conversations/xmpp/jingle/ToneManager.java index b64f963d0ead71f0d1e8f140d2a5fdd5a70002ce..2ee3070824c8771c16eeb24d6c7d15183a0b9193 100644 --- a/src/main/java/eu/siacs/conversations/xmpp/jingle/ToneManager.java +++ b/src/main/java/eu/siacs/conversations/xmpp/jingle/ToneManager.java @@ -160,8 +160,17 @@ class ToneManager { if (currentTone != null) { currentTone.cancel(true); } - if (toneGenerator != null) { + stopTone(toneGenerator); + } + + private static void stopTone(final ToneGenerator toneGenerator) { + if (toneGenerator == null) { + return; + } + try { toneGenerator.stopTone(); + } catch (final RuntimeException e) { + Log.w(Config.LOGTAG,"tone has already stopped"); } }