From 25678293637a87ba2d0c84489fecd9c79aba0514 Mon Sep 17 00:00:00 2001 From: gedoor Date: Sun, 1 Aug 2021 11:05:47 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/io/legado/app/receiver/MediaButtonReceiver.kt | 5 ++--- 1 file changed, 2 insertions(+), 3 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 d32e4934c..79d53779e 100644 --- a/app/src/main/java/io/legado/app/receiver/MediaButtonReceiver.kt +++ b/app/src/main/java/io/legado/app/receiver/MediaButtonReceiver.kt @@ -22,7 +22,6 @@ import io.legado.app.utils.postEvent * Created by GKF on 2018/1/6. * 监听耳机键 */ - class MediaButtonReceiver : BroadcastReceiver() { override fun onReceive(context: Context, intent: Intent) { @@ -36,8 +35,8 @@ class MediaButtonReceiver : BroadcastReceiver() { fun handleIntent(context: Context, intent: Intent): Boolean { val intentAction = intent.action if (Intent.ACTION_MEDIA_BUTTON == intentAction) { - val keyEvent = - intent.getParcelableExtra(Intent.EXTRA_KEY_EVENT) ?: return false + val keyEvent = intent.getParcelableExtra(Intent.EXTRA_KEY_EVENT) + ?: return false val keycode: Int = keyEvent.keyCode val action: Int = keyEvent.action if (action == KeyEvent.ACTION_DOWN) {