|
|
@@ -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
|
|
|
|
|
|
@@ -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) {
|
|
|
@@ -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)) {
|