catch runtime exception when trying to stop tone manager
This commit is contained in:
parent
963f8ccee4
commit
6289e048b3
|
@ -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");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue