From 0c7c225e9f9cd74727651a306f4949f93b99b0af Mon Sep 17 00:00:00 2001 From: kunfei Date: Wed, 11 Sep 2019 09:10:21 +0800 Subject: [PATCH] up --- app/src/main/java/io/legado/app/service/ReadAloudService.kt | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/app/src/main/java/io/legado/app/service/ReadAloudService.kt b/app/src/main/java/io/legado/app/service/ReadAloudService.kt index c6c2cec12..5e4638dc1 100644 --- a/app/src/main/java/io/legado/app/service/ReadAloudService.kt +++ b/app/src/main/java/io/legado/app/service/ReadAloudService.kt @@ -125,7 +125,6 @@ class ReadAloudService : BaseService(), TextToSpeech.OnInitListener, private lateinit var audioManager: AudioManager private lateinit var mFocusRequest: AudioFocusRequest private var broadcastReceiver: BroadcastReceiver? = null - private var speak: Boolean = true private var nowSpeak: Int = 0 private val contentList = arrayListOf() private var readAloudNumber: Int = 0 @@ -147,7 +146,6 @@ class ReadAloudService : BaseService(), TextToSpeech.OnInitListener, } initMediaSession() initBroadcastReceiver() - upMediaSessionPlaybackState(PlaybackStateCompat.STATE_PLAYING) upSpeechRate() ReadAloudNotification.upNotification(this) } @@ -363,7 +361,7 @@ class ReadAloudService : BaseService(), TextToSpeech.OnInitListener, } private fun pauseReadAloud(pause: Boolean) { - if (pause) postEvent(Bus.ALOUD_STATE, Status.PAUSE) + postEvent(Bus.ALOUD_STATE, Status.PAUSE) this.pause = pause textToSpeech?.stop() upMediaSessionPlaybackState(PlaybackStateCompat.STATE_PAUSED)