Skip to content

Commit

Permalink
Fix #3084 (Crash (TTS))
Browse files Browse the repository at this point in the history
  • Loading branch information
tuomas2 committed Dec 2, 2023
1 parent 725fc83 commit 3bd2db7
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,9 @@ class TextToSpeechNotificationManager {

private fun stop(removeNotification: Boolean = false) {
Log.i(TAG, "STOP_SERVICE")
wakeLock.release()
if(wakeLock.isHeld) {
wakeLock.release()
}
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
stopForeground(if(removeNotification) STOP_FOREGROUND_REMOVE else STOP_FOREGROUND_DETACH)
} else {
Expand Down

0 comments on commit 3bd2db7

Please sign in to comment.