Skip to content

Commit

Permalink
优化
Browse files Browse the repository at this point in the history
  • Loading branch information
821938089 committed Sep 25, 2024
1 parent 80a359b commit 72af4d7
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import io.legado.app.service.AudioPlayService
import io.legado.app.service.BaseReadAloudService
import io.legado.app.ui.book.audio.AudioPlayActivity
import io.legado.app.ui.book.read.ReadBookActivity
import io.legado.app.utils.LogUtils
import io.legado.app.utils.getPrefBoolean
import io.legado.app.utils.postEvent

Expand All @@ -33,6 +34,8 @@ class MediaButtonReceiver : BroadcastReceiver() {

companion object {

private const val TAG = "MediaButtonReceiver"

fun handleIntent(context: Context, intent: Intent): Boolean {
val intentAction = intent.action
if (Intent.ACTION_MEDIA_BUTTON == intentAction) {
Expand All @@ -42,6 +45,7 @@ class MediaButtonReceiver : BroadcastReceiver() {
val keycode: Int = keyEvent.keyCode
val action: Int = keyEvent.action
if (action == KeyEvent.ACTION_DOWN) {
LogUtils.d(TAG, "Receive mediaButton event, keycode:$keycode")
when (keycode) {
KeyEvent.KEYCODE_MEDIA_PREVIOUS -> {
if (context.getPrefBoolean("mediaButtonPerNext", false)) {
Expand Down

0 comments on commit 72af4d7

Please sign in to comment.