Skip to content

Commit

Permalink
#416 Catch an exception
Browse files Browse the repository at this point in the history
  • Loading branch information
AEFeinstein committed Jul 10, 2018
1 parent 2ca9026 commit 466ae35
Showing 1 changed file with 8 additions and 4 deletions.
Expand Up @@ -269,10 +269,14 @@ private void VerifyPlayNotificationSoundOrTTS(final Context context, Boolean pla
}

private void PlayNotificationSoundOrTTS(final Context context, Boolean useSound, String soundURI, int textID) {
if (useSound) {
PlayNotificationSound(context, soundURI);
} else {
context.startService(new Intent(context, TtsService.class).putExtra(TEXT_TO_SPEAK, textID));
try {
if (useSound) {
PlayNotificationSound(context, soundURI);
} else {
context.startService(new Intent(context, TtsService.class).putExtra(TEXT_TO_SPEAK, textID));
}
} catch (IllegalStateException e) {
/* Eat it */
}
}

Expand Down

0 comments on commit 466ae35

Please sign in to comment.