From 5a3224f55fb867847727de51006468fa8fe6be75 Mon Sep 17 00:00:00 2001 From: kunfei Date: Wed, 11 Sep 2019 10:43:50 +0800 Subject: [PATCH] up --- .../main/java/io/legado/app/service/ReadAloudService.kt | 7 ++++--- 1 file changed, 4 insertions(+), 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 baa368760..e3c47eec2 100644 --- a/app/src/main/java/io/legado/app/service/ReadAloudService.kt +++ b/app/src/main/java/io/legado/app/service/ReadAloudService.kt @@ -345,12 +345,13 @@ class ReadAloudService : BaseService(), TextToSpeech.OnInitListener, mediaSessionCompat?.isActive = true } + /** + * 断开耳机监听 + */ private fun initBroadcastReceiver() { - //断开耳机监听 broadcastReceiver = object : BroadcastReceiver() { override fun onReceive(context: Context, intent: Intent) { - val action = intent.action - if (AudioManager.ACTION_AUDIO_BECOMING_NOISY == action) { + if (AudioManager.ACTION_AUDIO_BECOMING_NOISY == intent.action) { pauseReadAloud(true) } }