Music is not paused when using my earphones
Hello,
I have Jabra earphones and sometimes pressing on them doesn't pause the music.
I don't have this issue with my other music player.
Unfortunately I didn't find any useful log related to remix.myplayer when reproducing the issue.
Android 14 - LineageOS - OnePlus 8 Pro
App info: APPLICATION_ID: remix.myplayer VERSION_CODE: 16400 VERSION_NAME: 1.6.4.0 FLAVOR: nonGoogleWithUpdater BUILD_TYPE: release GITHUB_SHA: null
System info: DISPLAY: lineage_instantnoodlep-userdebug 14 AP2A.240705.005 8fcd721f7e SUPPORTED_ABIS: [arm64-v8a, armeabi-v7a, armeabi] MANUFACTURER: OnePlus MODEL: IN2020 RELEASE: 14 SDK_INT: 34
https://github.com/rRemix/APlayer/blob/b6038563804485f884d8ab184761af11161ee367/app/src/main/java/remix/myplayer/misc/receiver/MediaButtonReceiver.kt#L38
Look for that in your log. It should appear almost immediately every time you press your earphone.
I took time to be able to reproduce the issue. Everything worked fine, I pressed on my earphones several times and it always worked. A few minutes ago, I tried again and I can no longer paused with the earphones. I recorded a log when trying to pause 3 times.
Disconnecting the earphones didn't help. I had to force close APlayer to be able to pause with the earphones.
1723541771.230 1000 1781 2965 D MediaSessionService: Sending KeyEvent { action=ACTION_UP, keyCode=KEYCODE_MEDIA_PLAY, scanCode=0, metaState=0, flags=0x0, repeatCount=0, eventTime=0, downTime=0, deviceId=-1, source=0x0, displayId=-1 } to de.danoeh.antennapod/PlaybackService/55 (userId=0)
Seems that de.danoeh.antennapod is capturing the key event
Try disabling (pm disable) it when you encounter the issue again
I disabled de.danoeh.antennapod with Termux.
It seems the device is still trying to send the KeyEvent to AntennaPod app instead of APlayer.
PendingIntentHolder: Sending KeyEvent { action=ACTION_UP, keyCode=KEYCODE_MEDIA_PLAY, scanCode=0, metaState=0, flags=0x0, repeatCount=0, eventTime=0, downTime=0, deviceId=-1, source=0x0, displayId=-1 } to the last known PendingIntent PendingIntent{ecd98c3: PendingIntentRecord{9ce1019 de.danoeh.antennapod broadcastIntent}}
FWIW I don't have this issue with my previous music player.
- Try uninstalling that app if it's acceptable for you
uid, and if possiblepidof APlayer- The log when APlayer started may also be useful
- I really suggest debugging yourself as I am currently working on some other things and don't have much time. Related code: https://github.com/rRemix/APlayer/blob/88e40796467647072ed1f9cee83a8a7556427812/app/src/main/java/remix/myplayer/service/MusicService.kt#L589 and
app/src/main/java/remix/myplayer/misc/receiver/MediaButtonReceiver.kt