From 365c17b52b3326596d247d78911d409d34a5a139 Mon Sep 17 00:00:00 2001 From: kunfei Date: Wed, 18 Sep 2019 22:34:38 +0800 Subject: [PATCH] up --- .../main/java/io/legado/app/receiver/MediaButtonReceiver.kt | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/app/src/main/java/io/legado/app/receiver/MediaButtonReceiver.kt b/app/src/main/java/io/legado/app/receiver/MediaButtonReceiver.kt index a3f7eb8ac..5d3519c22 100644 --- a/app/src/main/java/io/legado/app/receiver/MediaButtonReceiver.kt +++ b/app/src/main/java/io/legado/app/receiver/MediaButtonReceiver.kt @@ -24,11 +24,7 @@ class MediaButtonReceiver : BroadcastReceiver() { val intentAction = intent.action LogUtils.log("耳机按键: $intentAction") if (Intent.ACTION_MEDIA_BUTTON == intentAction) { - val event = - intent.getParcelableExtra(Intent.EXTRA_KEY_EVENT) ?: return false - - val action = event.action - + val action = intent.getParcelableExtra(Intent.EXTRA_KEY_EVENT)?.action if (action == KeyEvent.ACTION_DOWN) { readAloud(context) return true